Repository navigation
air run: warn when code imports torch on the Standard environment - #7650
Closed
anshul0713 wants to merge 2 commits into
Closed
anshul0713 wants to merge 2 commits into
anshul0713 wants to merge 2 commits into
Conversation
The Standard environment has not included PyTorch since version 5. A workload that imports torch there passes --dry-run, then fails only after it waits for a GPU, and the default retries repeat the failure. Agents hit this in most CAJ trials on the released CLI. Scan the code_source's .py files and warn before submitting, pointing at databricks_ai_v6 or a torch dependency. Co-authored-by: Isaac <no-reply@databricks.com> (cherry picked from commit 6d641a4658e301209c20136d4eb09303d4568125)
Contributor
|
Thanks for the contribution! This pull request was opened from a fork. If you're a member of the Databricks organization, please request access to the If you're an external contributor, no action is needed; a maintainer will review your pull request. |
Co-authored-by: Isaac <no-reply@databricks.com>
Contributor
|
An authorized user can trigger integration tests manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
Contributor
Author
|
Superseded by #7656: the same change, opened from a branch in this repo so the full CI and integration tests can run. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Changes
databricks air run, including--dry-run, now prints a warning before submitting in this case:code_sourcehas a.pyfile that importstorch, andtorchisn't inenvironment.dependencies.The check is skipped for
unity_catalog_image, multi-container workloads,databricks_ai_v*, versions before 5, and dependency lists that reference a requirements file. It scans at most 200.pyfiles of up to 1 MiB each. It's only a hint and never blocks a submission.Why
This config passes
--dry-run, then fails withModuleNotFoundErroronly after the run has waited for a GPU, and the defaultmax_retries: 3queues the same failure again. On the released v1.26.0, 2 of 3 agent trials of a 1x A10 PyTorch training task hit this, and one of them lost about 12 minutes waiting in the GPU queue before the failure showed up. Recent help text onmainpoints todatabricks_ai_v6, which makes this less common, but one trial still hit it onmain. This warning is a local safety net that costs nothing.Tests
TestMissingTorchWarning, a table test. It warns for the default and Standard 6 environments, forimport torchandfrom torch import, and when only other dependencies are listed. It stays quiet fordatabricks_ai_v6, atorchdependency, a requirements file, Standard 4, a custom image, and a commented-out import.acceptance/air/runhas two new cases. A Standard environment withimport torchwarns, anddatabricks_ai_v6doesn't.go test ./cmd/air/...andgo test ./acceptance -run TestAccept/airpass.This pull request and its description were written by Isaac.