Skip to content

Commit

Permalink
Remove everything related to our in-house Simplex
Browse files Browse the repository at this point in the history
  • Loading branch information
jacquev6 committed Dec 3, 2024
1 parent 94873aa commit f75baf9
Show file tree
Hide file tree
Showing 23 changed files with 9 additions and 2,319 deletions.
10 changes: 1 addition & 9 deletions development/cycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@
"--skip-wpb-alglib-unit", is_flag=True,
help="Skip WPB learnings using Alglib unit tests to save time.",
)
@click.option(
"--skip-wpb-in-house-simplex-unit", is_flag=True,
help="Skip WPB learnings using in-house Simplex LP solver unit tests to save time.",
)
@click.option(
"--skip-sat-unit", is_flag=True,
help="Skip SAT-based learnings unit tests to save time.",
Expand Down Expand Up @@ -130,7 +126,6 @@ def main(
skip_wpb_unit,
skip_wpb_glop_unit,
skip_wpb_alglib_unit,
skip_wpb_in_house_simplex_unit,
skip_sat_unit,
skip_max_sat_unit,
skip_cpp_unit,
Expand Down Expand Up @@ -193,7 +188,6 @@ def main(
skip_wpb=skip_wpb_unit,
skip_wpb_glop=skip_wpb_glop_unit,
skip_wpb_alglib=skip_wpb_alglib_unit,
skip_wpb_in_house_simplex=skip_wpb_in_house_simplex_unit,
skip_sat=skip_sat_unit,
skip_max_sat=skip_max_sat_unit,
doctest_options=doctest_option,
Expand Down Expand Up @@ -266,7 +260,7 @@ def print_title(title, under="="):
print(flush=True)


def run_cpp_tests(*, python_version, skip_long, skip_wpb, skip_wpb_glop, skip_wpb_alglib, skip_wpb_in_house_simplex, skip_sat, skip_max_sat, doctest_options):
def run_cpp_tests(*, python_version, skip_long, skip_wpb, skip_wpb_glop, skip_wpb_alglib, skip_sat, skip_max_sat, doctest_options):
suffix = "m" if int(python_version.split(".")[1]) < 8 else ""
subprocess.run(
[
Expand All @@ -288,8 +282,6 @@ def run_cpp_tests(*, python_version, skip_long, skip_wpb, skip_wpb_glop, skip_wp
env["LINCS_DEV_SKIP_WPB_GLOP"] = "true"
if skip_wpb_alglib:
env["LINCS_DEV_SKIP_WPB_ALGLIB"] = "true"
if skip_wpb_in_house_simplex:
env["LINCS_DEV_SKIP_WPB_IN_HOUSE_SIMPLEX"] = "true"
if skip_sat:
env["LINCS_DEV_SKIP_SAT"] = "true"
if skip_max_sat:
Expand Down
24 changes: 0 additions & 24 deletions doc-sources/reference/lincs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -988,30 +988,6 @@

Overrides the base method.

.. class:: OptimizeWeightsUsingInHouseSimplexOnCpu

The weights optimization strategy described in Olivier Sobrie's PhD thesis. The linear program is solved using our in-house Simplex, on the CPU. THIS IS AN EXPERIMENTAL FEATURE, you should probably not use it.

.. method:: __init__(preprocessed_learning_set: PreprocessedLearningSet, models_being_learned: ModelsBeingLearned)

Constructor. Keeps a reference to the learning data.

.. method:: optimize_weights(model_indexes_begin: int, model_indexes_end: int)

Overrides the base method.

.. class:: OptimizeWeightsUsingInHouseSimplexOnGpu

The weights optimization strategy described in Olivier Sobrie's PhD thesis. The linear program is solved using our in-house Simplex, on the GPU. THIS IS AN EXPERIMENTAL FEATURE, you should probably not use it.

.. method:: __init__(preprocessed_learning_set: PreprocessedLearningSet, models_being_learned: ModelsBeingLearned)

Constructor. Keeps a reference to the learning data.

.. method:: optimize_weights(model_indexes_begin: int, model_indexes_end: int)

Overrides the base method.

.. class:: ImproveProfilesWithAccuracyHeuristicOnCpu

The profiles improvement strategy described in Olivier Sobrie's PhD thesis. Run on the CPU.
Expand Down
8 changes: 0 additions & 8 deletions doc-sources/reference/lincs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -415,14 +415,6 @@ children:
children:
- name: __init__
- name: optimize_weights
- name: OptimizeWeightsUsingInHouseSimplexOnCpu
children:
- name: __init__
- name: optimize_weights
- name: OptimizeWeightsUsingInHouseSimplexOnGpu
children:
- name: __init__
- name: optimize_weights
- name: ImproveProfilesWithAccuracyHeuristicOnCpu
children:
- name: __init__
Expand Down
6 changes: 0 additions & 6 deletions integration-tests/dir-all/liblincs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,6 @@ liblincs: module
OptimizeWeightsUsingGlop: pybind11_type
__init__: instancemethod
optimize_weights: instancemethod
OptimizeWeightsUsingInHouseSimplexOnCpu: pybind11_type
__init__: instancemethod
optimize_weights: instancemethod
OptimizeWeightsUsingInHouseSimplexOnGpu: pybind11_type
__init__: instancemethod
optimize_weights: instancemethod
Performance: pybind11_type
Enumerated: pybind11_type
__getstate__: instancemethod
Expand Down
6 changes: 0 additions & 6 deletions integration-tests/dir-all/lincs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,6 @@ lincs: module
OptimizeWeightsUsingGlop: pybind11_type
__init__: instancemethod
optimize_weights: instancemethod
OptimizeWeightsUsingInHouseSimplexOnCpu: pybind11_type
__init__: instancemethod
optimize_weights: instancemethod
OptimizeWeightsUsingInHouseSimplexOnGpu: pybind11_type
__init__: instancemethod
optimize_weights: instancemethod
Performance: pybind11_type
Enumerated: pybind11_type
__getstate__: instancemethod
Expand Down
14 changes: 1 addition & 13 deletions integration-tests/help-all/help-all.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@
" - '--mrsort.strategy' is 'weights-profiles-breed'\n",
" \n",
" [default: linear-program]\n",
" --mrsort.weights-profiles-breed.linear-program.solver [glop|alglib|experimental-in-house-simplex]\n",
" --mrsort.weights-profiles-breed.linear-program.solver [glop|alglib]\n",
" The solver to use to solve the linear\n",
" programs.\n",
" \n",
Expand All @@ -475,18 +475,6 @@
" - '--mrsort.weights-profiles-breed.weights-strategy' is 'linear-program'\n",
" \n",
" [default: glop]\n",
" --mrsort.weights-profiles-breed.linear-program.experimental-in-house-simplex.processor [cpu|gpu]\n",
" The processor to use to solve the linear\n",
" program using our EXPERIMENTAL in-house\n",
" Simplex (that you should probably not use).\n",
" \n",
" Only valid if:\n",
" - '--model-type' is 'mrsort'\n",
" - '--mrsort.strategy' is 'weights-profiles-breed'\n",
" - '--mrsort.weights-profiles-breed.weights-strategy' is 'linear-program'\n",
" - '--mrsort.weights-profiles-breed.linear-program.solver' is 'experimental-in-house-simplex'\n",
" \n",
" [default: cpu]\n",
" --mrsort.weights-profiles-breed.profiles-strategy [accuracy-heuristic]\n",
" The strategy to use to improve the profiles\n",
" of the MRSort models.\n",
Expand Down
3 changes: 0 additions & 3 deletions integration-tests/in-house-simplex-on-cpu-learning/.gitignore

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions integration-tests/in-house-simplex-on-gpu-learning/.gitignore

This file was deleted.

This file was deleted.

Empty file.
5 changes: 0 additions & 5 deletions lincs/classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@
from liblincs import ImproveProfilesWithAccuracyHeuristicOnGpu
except ImportError:
pass
from liblincs import OptimizeWeightsUsingInHouseSimplexOnCpu
try:
from liblincs import OptimizeWeightsUsingInHouseSimplexOnGpu
except ImportError:
pass
from liblincs import ReinitializeLeastAccurate
from liblincs import TerminateAtAccuracy
from liblincs import TerminateAfterSeconds, TerminateAfterSecondsWithoutProgress
Expand Down
26 changes: 2 additions & 24 deletions lincs/command_line_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -716,25 +716,11 @@ def learn():
"solver",
dict(
help="The solver to use to solve the linear programs.",
type=click.Choice(["glop", "alglib", "experimental-in-house-simplex"]),
type=click.Choice(["glop", "alglib"]),
default="glop",
show_default=True,
),
{
"experimental-in-house-simplex": [
(
"processor",
dict(
help="The processor to use to solve the linear program using our EXPERIMENTAL in-house Simplex (that you should probably not use)."
+ ("" if lincs.has_gpu else " (Only 'cpu' is available because lincs was compiled without 'nvcc')"),
type=click.Choice(["cpu"] + (["gpu"] if lincs.has_gpu else [])),
default="cpu",
show_default=True,
),
{},
)
]
},
{},
),
],
},
Expand Down Expand Up @@ -847,7 +833,6 @@ def classification_model(
mrsort__weights_profiles_breed__initialization_strategy,
mrsort__weights_profiles_breed__weights_strategy,
mrsort__weights_profiles_breed__linear_program__solver,
mrsort__weights_profiles_breed__linear_program__experimental_in_house_simplex__processor,
mrsort__weights_profiles_breed__profiles_strategy,
mrsort__weights_profiles_breed__accuracy_heuristic__random_seed,
mrsort__weights_profiles_breed__accuracy_heuristic__processor,
Expand Down Expand Up @@ -891,13 +876,6 @@ def classification_model(
weights_optimization_strategy = lincs.classification.OptimizeWeightsUsingGlop(preprocessed_learning_set, models_being_learned)
elif mrsort__weights_profiles_breed__linear_program__solver == "alglib":
weights_optimization_strategy = lincs.classification.OptimizeWeightsUsingAlglib(preprocessed_learning_set, models_being_learned)
elif mrsort__weights_profiles_breed__linear_program__solver == "experimental-in-house-simplex":
command_line += ["--mrsort.weights-profiles-breed.linear-program.experimental-in-house-simplex.processor", mrsort__weights_profiles_breed__linear_program__experimental_in_house_simplex__processor]
if mrsort__weights_profiles_breed__linear_program__experimental_in_house_simplex__processor == "cpu":
weights_optimization_strategy = lincs.classification.OptimizeWeightsUsingInHouseSimplexOnCpu(preprocessed_learning_set, models_being_learned)
elif mrsort__weights_profiles_breed__linear_program__experimental_in_house_simplex__processor == "gpu":
assert lincs.has_gpu
weights_optimization_strategy = lincs.classification.OptimizeWeightsUsingInHouseSimplexOnGpu(preprocessed_learning_set, models_being_learned)

command_line += ["--mrsort.weights-profiles-breed.profiles-strategy", mrsort__weights_profiles_breed__profiles_strategy]
if mrsort__weights_profiles_breed__profiles_strategy == "accuracy-heuristic":
Expand Down
Loading

0 comments on commit f75baf9

Please sign in to comment.