-
Notifications
You must be signed in to change notification settings - Fork 30
XCSP3 in tools #597
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: master
Are you sure you want to change the base?
XCSP3 in tools #597
Conversation
todo: readme, add python an package requirements somewhere |
cpmpy/tools/xcsp3/tests/run_model.py
Outdated
|
||
|
||
|
||
def write_to_dataframe(lock, model_name, t_solve, t_transform, df_path): |
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.
add solvername
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.
Some general comments:
- the has_subexprs should be mainlined in a separate pull request?
- I think we should rename the files a bit to set better expectations:
- callbacks: parser_callbacks? or pycsp3_callbacks?
- installer: this is actually not an installer of pycsp3 or the parser... its about downloading instances I think? so, xcsp3_downloader?
- solution.py: I have no idea... should just be part of run_model?
I guess we might have 2 runners: a runner that is competition-ready (e.g. it accepts the args and writes in the format that the competition expects)
and a runner that we can use to benchmark our code? e.g. that logs specific runtimes to a csv file? - xglobals... I guess this is included by the callbacks file? maybe just extra_globals.py or xcsp3_globals.py?
also I'm a bit surprsied by the 'tests' subfolder and run_models being in that... |
cleaned up the printing a bit. doesn't work:
Ran models for 0 minutes it doesnt look like shorttable is already in the globals, though it does expect it? |
the has_subexpr for table is indeed in another pr: #596 Will update the file names |
Good, but the downloader is a hack... I think we should follow Serdar's opinion piece: https://osullivan.ucc.ie/CPML2025/papers/kadioglu.pdf E.g torch has a very elegant dataset class (I'm not suggesting we import torch, but we could mimic such an abstract class): where a dataset just needs to implement init, len and getitim... e.g. we could imagine a class like
which would do the downloading like their MNIST dataset etc do... getitem would return (y, x) where y = whatever metadata xcsp3 has about it (e.g. optimal value, name, category, ...), and 'x' is the xcsp3 string xml what's nice, is that we could then imagine a function
or something? This is just a brainstorm, esp the parse_xcsp3 as a transform... but instead of the current downloader, creating a generic non-CPMpy specific dataset object following the torch style would be great... |
Should also have an easy benchmarking script.