-
Couldn't load subscription status.
- Fork 21
feat: snakemakeify hacker's delight #1549
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
|
How would the |
|
It would be cool if we could hook it up with |
|
@ineol I added an example. Sadly, I learnt today that snakemake's notion of limits are not imposed by the runner, but are only used by the scheduler :) Regardless, we can query those parameters and use then in our call. |
|
@ineol , if I could get a thumbs up from you for the config, that would be great :) |
|
What does the python thing do in the first rule? Does it update the venv when the Relatedly, can we use pip to install snakemake as well? |
We refactor this into a separate 'liblimits.py, which will be shared across our evaluation scripts.
|
@ineol Indeed, we can use |
f39c52b to
7b10b20
Compare
|
NIT: I'd expect some |
😢 |
|
In general, I'm not a big fan of the fact that when something breaks, it vomits up heaps of non-informative "thing broke because something returned a non-zero status code" logs. Just show me the actual error! Just look at the signal/noise ratio in the following log! |
|
@alexkeizer @ineol @luisacicolini , I would appreciate it if you could try this again. Please run |
|
bv_decide solved 0 theorems. |
|
I tried to install bitwuzla but it could not download gmp because |
|
bv_decide solved 0 theorems. |
2 similar comments
|
bv_decide solved 0 theorems. |
|
bv_decide solved 0 theorems. |
|
Also @bollu could you double check what metadata you generate, and add it to .gitignore. I got a bunch of stuff under |
|
bv_decide solved 0 theorems. |
2 similar comments
|
bv_decide solved 0 theorems. |
|
bv_decide solved 0 theorems. |
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.
While running inside the nix dev-shell, it dies with the following error:
Traceback (most recent call last):
File "/home/alex/Workspace/PhD/lean-mlir-alt/bv-evaluation/.venv/lib/python3.12/site-packages/snakemake/cli.py", line 2165, in args_to_api
dag_api.execute_workflow(
File "/home/alex/Workspace/PhD/lean-mlir-alt/bv-evaluation/.venv/lib/python3.12/site-packages/snakemake/api.py", line 603, in execute_workflow
workflow.execute(
File "/home/alex/Workspace/PhD/lean-mlir-alt/bv-evaluation/.venv/lib/python3.12/site-packages/snakemake/workflow.py", line 1405, in execute
raise e
File "/home/alex/Workspace/PhD/lean-mlir-alt/bv-evaluation/.venv/lib/python3.12/site-packages/snakemake/workflow.py", line 1401, in execute
success = self.scheduler.schedule()
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/alex/Workspace/PhD/lean-mlir-alt/bv-evaluation/.venv/lib/python3.12/site-packages/snakemake/scheduler.py", line 356, in schedule
raise e
File "/home/alex/Workspace/PhD/lean-mlir-alt/bv-evaluation/.venv/lib/python3.12/site-packages/snakemake/scheduler.py", line 200, in schedule
self._finish_jobs()
File "/home/alex/Workspace/PhD/lean-mlir-alt/bv-evaluation/.venv/lib/python3.12/site-packages/snakemake/scheduler.py", line 432, in _finish_jobs
async_run(postprocess())
File "/home/alex/Workspace/PhD/lean-mlir-alt/bv-evaluation/.venv/lib/python3.12/site-packages/snakemake/common/__init__.py", line 99, in async_run
return asyncio.run(coroutine)
^^^^^^^^^^^^^^^^^^^^^^
File "/home/alex/.local/share/uv/python/cpython-3.12.11-linux-x86_64-gnu/lib/python3.12/asyncio/runners.py", line 195, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/home/alex/.local/share/uv/python/cpython-3.12.11-linux-x86_64-gnu/lib/python3.12/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/alex/.local/share/uv/python/cpython-3.12.11-linux-x86_64-gnu/lib/python3.12/asyncio/base_events.py", line 691, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/home/alex/Workspace/PhD/lean-mlir-alt/bv-evaluation/.venv/lib/python3.12/site-packages/snakemake/scheduler.py", line 375, in postprocess
await job.postprocess(
File "/home/alex/Workspace/PhD/lean-mlir-alt/bv-evaluation/.venv/lib/python3.12/site-packages/snakemake/jobs.py", line 1260, in postprocess
await self.dag.workflow.persistence.finished(self)
File "/home/alex/Workspace/PhD/lean-mlir-alt/bv-evaluation/.venv/lib/python3.12/site-packages/snakemake/persistence.py", line 317, in finished
params = self._params(job)
^^^^^^^^^^^^^^^^^
File "/home/alex/Workspace/PhD/lean-mlir-alt/bv-evaluation/.venv/lib/python3.12/site-packages/snakemake/persistence.py", line 631, in _params
return sorted(
^^^^^^^
File "/home/alex/Workspace/PhD/lean-mlir-alt/bv-evaluation/.venv/lib/python3.12/site-packages/snakemake/persistence.py", line 634, in <genexpr>
(self._serialize_param(value) for value in job.non_derived_params),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/alex/Workspace/PhD/lean-mlir-alt/bv-evaluation/.venv/lib/python3.12/site-packages/snakemake/persistence.py", line 623, in _serialize_param_pandas
import pandas as pd
File "/nix/store/27drr45ziv3kbjl4pdzdh1cic7ncvpp2-python3-3.13.4-env/lib/python3.13/site-packages/pandas/__init__.py", line 19, in <module>
raise ImportError(
ImportError: Unable to import required dependencies:
numpy: Error importing numpy: you should not try to import numpy from
its source directory; please exit the numpy source tree, and relaunch
your python interpreter from there.
| onstart: | ||
| shell("elan --version") | ||
| shell("cd {gitroot} && lake exe cache get && lake build") | ||
| shell("uv --version") | ||
| shell("bitwuzla --version") |
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.
Should this be redirecting outputs to log files?
You might also want to print some prelude information before dumping elan --version straight to the user.
…ct_and_plot outputs, so that the raw-data folder gets created by snakemake and we can thus drop the .placeholder
This was a nix-skill-issue: the posted error is really saying that numpy failed to load the C extension, which is presumably caused by nix being nix. The fix was to ensure that |
|
bv_decide solved 0 theorems. |
1 similar comment
|
bv_decide solved 0 theorems. |
|
It seems the mathlib cache is download twice for me: |
|
bv_decide solved 0 theorems. |
I merged the latest |
|
After tweaking flake.nix to install numpy for the specific python version that snakemake wants, this now works on my side! LGTM |
|
@tobiasgrosser I have an LGTM from Alex, so I propose to merge this. |
As per #1613, I'm experimenting with an alternative CI setup where we run everything inside a Docker container. Until we commit to this being the workflow we like, I'll duplicate existing CI jobs and have a *seperate* job run the same action inside the container (on a GH-provided runner, but using the image we built on namespace's runner). This PR does so for the CI job that builds the non-standard build targets and the Instcombine evaluation (but not yet for hackersdelight, for that I'm waiting on #1549). To make this work, I: - Add more stuff to the .dockerignore file, so files which are not needed are not copied to the Docker image (and thus won't trigger cache misses). - Expand the existing bitwuzla image to also install uv, use uv to install the python dependencies specified in requirements.txt, and copy the lean-mlir files from the base-image to get a full-blown instcombine image; the produced image is thus renamed to `lean-mlir-instcombine`. Note that this second image is still build on GH runner infrastructure! This is fine as we don't actually `lake build` anything here, so there is no need for incremental caching (but of course, using namespace.so would still likely be faster). - I tried dropping permissions in the Dockerfile to use a non-root user - Github will change the home-directory to `/github/home`, so I originally thought it was using a github user because of security concerns with using a root user. Thus, I tried to set a `USER` in the dockerfile. - However, it just made everything more complicated, and random actions started failing with permission errors. - Then I tried setting the home-directory explictly to `/root` using `env.var`, but then actions started complaining about `/root/.docker/config.json` not existing... - Just leaving the status quo is non-ideal, as .elan was re-downloading the toolchain (since the Docker image has it at /root/.elan, while in the action it was looking at `/github/home/.elan` - Finally, I worked around it by adding a first run step that symlinks the latter to the former to every job that runs in a container. It's not the most elegant, as it adds a boilerplate run step to every job, but it actually works, so 🤷
This shows how we would use
snakemaketo gradually migrate our plotting pipeline for hacker's delight.See that
snakemakenow subsumes the (hard) job of task running incollect.py.It leaves the CSV wranging in
collect.pyandplot.pyuntouched, as these have been vetted by @luisacicolini .This provides parallelism at the task level, and I would like to believe, is much more declarative on how the hacker's delight files are built.