-
Notifications
You must be signed in to change notification settings - Fork 0
[WIP] Add Julia interface for cuPDLPx #2
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
base: main
Are you sure you want to change the base?
Conversation
|
There's a lot of stuff there. You should wrap only the public C API. What functions is the user expected to call? |
| reflection_coefficient::Cdouble | ||
| end | ||
|
|
||
| struct pdhg_solver_state_t |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example, I assume the user shouldn't need access to this struct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it.
| f === :csc && return Ptr{var"##Ctag#234"}(x + 0) | ||
| f === :coo && return Ptr{var"##Ctag#235"}(x + 0) | ||
| return getfield(x, f) | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And I don't know what this function is
|
|
||
| function safe_malloc(size) | ||
| ccall((:safe_malloc, libcupdlpx), Ptr{Cvoid}, (Csize_t,), size) | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this should almost certainly not be exposed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it.
| end | ||
|
|
||
| function read_mps_file(filename) | ||
| ccall((:read_mps_file, libcupdlpx), Ptr{lp_problem_t}, (Ptr{Cchar},), filename) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But stuff like this should be
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m a bit confused here. Since the goal of this API is to interact with JuMP, do we still need this functionality, given that JuMP already provides the read_from_file function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This falls into the question of "what is your public API?"
People might want to interact with cuPDLPx directly, from Julia, and without JuMP.
Something like:
using cuPDLPx
model = cuPDLPx.read_mps_file(filename)
cuPDLPx.optimize(model)
x = cuPDLPx.get_solution(model)(Or whatever, I don't know the C API functions)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the input, @odow. That’s a good point — we may need to reorganize the C API functions in cuPDLPx.
|
Thank you so much for the suggestion, @odow. I wasn’t very familiar with Clang.jl before — I’ll make sure to wrap only the public C API.
|
Desciption
This PR adds the Julia interface for cuPDLPx, a GPU-accelerated first-order LP solver.
A JLL package has already been created and merged into Yggdrasil.
The next step is to build the C API wrapper using
Clang.jl, which is still a work in progress due to several CUDA header dependencies.Below is an example output from the current code generation workflow.
Any feedback or suggestions from the Julia or JuMP community would be greatly appreciated. @odow @blegat