Skip to content

Commit 9182e1a

Browse files
committed
fix(Makefile): narrow TORCH_GROUP override to the setup_env.sh call only
`export TORCH_GROUP=torch_2_X && ...` set the variable for the whole recipe's shell, which happened to be harmless since nothing else in these three recipes reads TORCH_GROUP, but the intent was always to scope the override to just the one setup_env.sh invocation that needs it. Using `TORCH_GROUP=torch_2_X <command>` as an inline prefix does that precisely: it applies only to the first command in the `&&` chain, reverting to the Makefile's own default/command-line value for everything after.
1 parent e4e6adb commit 9182e1a

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

Makefile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,7 @@ env: _maybe_patch_pyproject
181181

182182
# Set up development environment with latest supported PyTorch version
183183
env-highest-torch: _maybe_patch_pyproject
184-
@export TORCH_GROUP=torch_2_11 && \
185-
$(SETUP_ENV) --venv $(VENV_HIGHEST_TORCH) --python-version $(PYTHON_VERSION)
184+
@TORCH_GROUP=torch_2_11 $(SETUP_ENV) --venv $(VENV_HIGHEST_TORCH) --python-version $(PYTHON_VERSION)
186185
@$(call write_active_venv,$(VENV_HIGHEST_TORCH))
187186

188187
# Set up environment for running tutorials (quantization notebook)
@@ -251,8 +250,7 @@ test-smoke:
251250
# Run tests on lowest supported PyTorch version (pass PYTEST_ARGS for custom flags)
252251
test-lowest-pytorch:
253252
@echo "Running tests on lowest PyTorch version supported..."
254-
@export TORCH_GROUP=torch_2_8 && \
255-
$(call use_env,VENV_LOWEST_TORCH) && \
253+
@TORCH_GROUP=torch_2_8 $(call use_env,VENV_LOWEST_TORCH) && \
256254
echo "Testing with lowest supported PyTorch versions" && \
257255
uv run --no-sync --active python $(SCRIPTS)/make/log_versions.py && \
258256
$(RUN_TESTS) $(PYTEST_ARGS) && \
@@ -261,8 +259,7 @@ test-lowest-pytorch:
261259
# Run tests on highest supported PyTorch version (pass PYTEST_ARGS for custom flags)
262260
test-highest-pytorch:
263261
@echo "Running tests on highest PyTorch version supported..."
264-
@export TORCH_GROUP=torch_2_11 && \
265-
$(call use_env,VENV_HIGHEST_TORCH) && \
262+
@TORCH_GROUP=torch_2_11 $(call use_env,VENV_HIGHEST_TORCH) && \
266263
echo "Testing with latest supported PyTorch versions" && \
267264
uv run --no-sync --active python $(SCRIPTS)/make/log_versions.py && \
268265
$(RUN_TESTS) $(PYTEST_ARGS) && \

0 commit comments

Comments
 (0)