Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gurobi wrapper #277

Merged
merged 129 commits into from
Jun 14, 2020
Merged

Gurobi wrapper #277

merged 129 commits into from
Jun 14, 2020

Conversation

guykatzz
Copy link
Collaborator

@guykatzz guykatzz commented Jun 4, 2020

A basic interface for invoking Gurobi and extracting the results

guykatzz and others added 30 commits April 1, 2020 16:24
@guykatzz guykatzz requested a review from yuvaljacoby June 9, 2020 15:05
@guykatzz guykatzz requested review from wu-haoze and castrong June 9, 2020 20:18
src/common/GurobiWrapper.cpp Show resolved Hide resolved
src/common/GurobiWrapper.h Show resolved Hide resolved
src/configuration/Options.cpp Outdated Show resolved Hide resolved
src/engine/Engine.cpp Outdated Show resolved Hide resolved
src/nlr/LPFormulator.cpp Outdated Show resolved Hide resolved
src/nlr/Layer.cpp Show resolved Hide resolved
src/nlr/Layer.cpp Show resolved Hide resolved
CMakeLists.txt Outdated
Comment on lines 170 to 185
if (${ENABLE_GUROBI})
add_compile_definitions(ENABLE_GUROBI)

set(GUROBI_LIB1 "gurobi_c++")
set(GUROBI_LIB2 "gurobi90")

add_library(${GUROBI_LIB1} SHARED IMPORTED)
set_target_properties(${GUROBI_LIB1} PROPERTIES IMPORTED_LOCATION ${GUROBI_DIR}/lib/libgurobi_c++.a)
list(APPEND LIBS ${GUROBI_LIB1})
target_include_directories(${GUROBI_LIB1} INTERFACE ${GUROBI_DIR}/include/)

add_library(${GUROBI_LIB2} SHARED IMPORTED)
set_target_properties(${GUROBI_LIB2} PROPERTIES IMPORTED_LOCATION ${GUROBI_DIR}/lib/libgurobi90.so)
list(APPEND LIBS ${GUROBI_LIB2})
target_include_directories(${GUROBI_LIB2} INTERFACE ${GUROBI_DIR}/include/)
endif()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to automatically set GUROBI_DIR or/and add instructions to the README

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes :)

@yuvaljacoby yuvaljacoby self-requested a review June 11, 2020 08:42
set_target_properties(${GUROBI_LIB2} PROPERTIES IMPORTED_LOCATION ${GUROBI_DIR}/lib/libgurobi90.so)
list(APPEND LIBS ${GUROBI_LIB2})
target_include_directories(${GUROBI_LIB2} INTERFACE ${GUROBI_DIR}/include/)
endif()

# pthread
set(THREADS_PREFER_PTHREAD_FLAG ON)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we make sure Gurobi uses 1 thread?

@guykatzz guykatzz merged commit 004cd8e into NeuralNetworkVerification:master Jun 14, 2020
@guykatzz guykatzz deleted the gurobi branch June 14, 2020 11:58
AleksandarZeljic pushed a commit to AleksandarZeljic/Marabou that referenced this pull request Oct 9, 2020
* types for PL constraints

* first attempt at automatically constructing the NLR

* first unit test, couple of bug fixes

* use PiecewiseLinearFunctionType

* cleanup

* some cleanup, and store more information about discovered neurons

* wip

* complete the construction of the NLR

* bug fixes

* bug fix

* dumping functionality

* bug fix

* test

* changes per Aleks' comments

* minor

* python bindings

* move nlr to separate dir, with namesapce

* move neuron index to separate class

* basic 'evaluate' functionality for non-consecutive layers

* layer class

* cleanup

* oops

* wip

* wip

* mechanism for extracting the bounds

* SBT for weighted sum layers

* symbolic bound propagation over a relu layer

* support for variable elimination and reindexing

* start restoring engine code

* cloning NLRs and layers

* clone NLRs as part of ipq cloning

* reinstate

* acas parser again creates an NLR

* cleanup in Layer class

* cleanup

* dumping functoinality

* bug fix in layer cloning

* dump

* bug fixes in copy ctor

* bug fix

* bug fix

* warm restart functionality

* property parsing

* cleanup, better handling of eliminated neurons

* a few more bug fixes

* minor

* auto construction of an NLR

* reinstate tests

* minor

* cleanup

* nlr renaming

* unsupported types

* cleanup

* minor

* reinstate the interval arithmetic bound propagation

* another test reinstated

* reinstate more tests

* more tests

* reinstate the remaining tests

* cleanup

* some clenaup

* bug fix

* cleanup

* dont eliminate input/output variables

* handle zero intervals

* started playing with gurobi

* basic wrapper functionality, and test

* better options

* support for compiling without Gurobi (default)

* test fix

* introducing a basic LP formalutor (WIP)

* handling ReLUs in the LP relaxation

* successfully creating the LP relaxation

* some statistics

* cleanup

* trigger the new code

* better NLR construction

* cosmetics

* oops

* some cleanup

* cleanup

* wip

* minor

* travis

* clear the boost cache

* and now restore the cache

* restore

* cleanup

* fix an issue from the merge

* even with master

* remove the notion of an "output layer" from the NLR

* oops

* code review comments

* oops

* farewell nlr

* add default gurobi_dir

* add build instructions for gurobi

Co-authored-by: Guy Katz <guykatz@cs.huji.ac.il>
Co-authored-by: Yuval Jacoby <yuval999@gmail.com>
matanost pushed a commit that referenced this pull request Nov 2, 2021
* types for PL constraints

* first attempt at automatically constructing the NLR

* first unit test, couple of bug fixes

* use PiecewiseLinearFunctionType

* cleanup

* some cleanup, and store more information about discovered neurons

* wip

* complete the construction of the NLR

* bug fixes

* bug fix

* dumping functionality

* bug fix

* test

* changes per Aleks' comments

* minor

* python bindings

* move nlr to separate dir, with namesapce

* move neuron index to separate class

* basic 'evaluate' functionality for non-consecutive layers

* layer class

* cleanup

* oops

* wip

* wip

* mechanism for extracting the bounds

* SBT for weighted sum layers

* symbolic bound propagation over a relu layer

* support for variable elimination and reindexing

* start restoring engine code

* cloning NLRs and layers

* clone NLRs as part of ipq cloning

* reinstate

* acas parser again creates an NLR

* cleanup in Layer class

* cleanup

* dumping functoinality

* bug fix in layer cloning

* dump

* bug fixes in copy ctor

* bug fix

* bug fix

* warm restart functionality

* property parsing

* cleanup, better handling of eliminated neurons

* a few more bug fixes

* minor

* auto construction of an NLR

* reinstate tests

* minor

* cleanup

* nlr renaming

* unsupported types

* cleanup

* minor

* reinstate the interval arithmetic bound propagation

* another test reinstated

* reinstate more tests

* more tests

* reinstate the remaining tests

* cleanup

* some clenaup

* bug fix

* cleanup

* dont eliminate input/output variables

* handle zero intervals

* started playing with gurobi

* basic wrapper functionality, and test

* better options

* support for compiling without Gurobi (default)

* test fix

* introducing a basic LP formalutor (WIP)

* handling ReLUs in the LP relaxation

* successfully creating the LP relaxation

* some statistics

* cleanup

* trigger the new code

* better NLR construction

* cosmetics

* oops

* some cleanup

* cleanup

* wip

* minor

* travis

* clear the boost cache

* and now restore the cache

* restore

* cleanup

* fix an issue from the merge

* even with master

* remove the notion of an "output layer" from the NLR

* oops

* code review comments

* oops

* farewell nlr

* add default gurobi_dir

* add build instructions for gurobi

Co-authored-by: Guy Katz <guykatz@cs.huji.ac.il>
Co-authored-by: Yuval Jacoby <yuval999@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants