Respect each example requirements and use uv #1330
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For: #1329
This commit introduces few changes to CI by modifying
run_*_examples.sh
and respective github workflows:start()
andstop()
methods wrapping up test bodies - these are called automatically)start()
) installs example dependencies and, optionally (ifVIRTUAL_ENV=.venv
is passed), creates uv virtual environmentstop()
) removes uv virtual environment if it was created (to save space)VIRTUAL_ENV
set, then scripts expect to be executed in the existing virtual environment. These can bepython -m venv
,uv env
orconda env
. In this case example dependencies will be installed in this environment potentially reinstalling existing packages (includingtorch
!).USE_CUDA=True
to be passed explicitlyPIP_INSTALL_ARGS
environment variable to be passed touv pip install
calls for each example dependencies. This allows to adjust torch indices and other options.Execute all tests in current virtual environment (might rewrite packages):
Execute all tests creating separate environment for each example:
Run with CUDA:
Adjust index:
Few changes were required in examples
requirements.txt
files:reinforcement_learning
requirement for number to be<2
due to:time_sequence_prediction
andword_language_model
requirement for torch to be<2.6
due to:CC: @msaroufim, @malfet, @atalman