Add repository fallback for experimental checkpoint downloads#198
Open
recrack wants to merge 3 commits into
Open
Add repository fallback for experimental checkpoint downloads#198recrack wants to merge 3 commits into
recrack wants to merge 3 commits into
Conversation
Author
|
'll run lint checks according to the contributing guidelines and submit a fix commit |
Add fallback logic to CheckpointFileHf._download() to support both nvidia/Cosmos-Experimental and nvidia-cosmos-ea/Cosmos-Experimental repositories. When downloading experimental checkpoints, try the original repository first, then fallback to the alternative repository if the first attempt fails. This ensures checkpoint downloads work even when only one of the repositories is accessible. Signed-off-by: Youngmin Yoo <recrack@gmail.com>
…fallback - Fix test_non_experimental_repository_no_fallback by adding os.path.exists mock - Ensures consistency with test_experimental_repository_fallback - All three repository fallback tests now pass successfully Signed-off-by: Youngmin Yoo <recrack@gmail.com>
- Fix 3 ruff errors (auto-fixed) - Format 2 files with ruff format - Pass all pre-commit checks
186ac06 to
b9a5a1a
Compare
Author
|
Updated. test result. |
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.
Fixes: #197
Problem
Users may lack permission to
nvidia/Cosmos-Experimentalbut have access tonvidia-cosmos-ea/Cosmos-Experimental. Current implementation fails immediately without trying the alternative repository.Summary
Add automatic repository fallback for experimental checkpoints. When
nvidia/Cosmos-Experimentaldownload fails, automatically retry withnvidia-cosmos-ea/Cosmos-Experimental.Changes
cosmos_transfer2/_src/imaginaire/utils/checkpoint_db.pyCheckpointFileHf._download()RuntimeErrorwhen all repositories failcosmos_transfer2/_src/imaginaire/utils/checkpoint_db_test.pytest_experimental_repository_fallback: Verifies successful fallback from primary to alternative repositorytest_non_experimental_repository_no_fallback: Ensures non-experimental repositories don't use fallback behaviortest_both_repositories_fail: ConfirmsRuntimeErroris raised when all repositories failTest Results: All 3 tests pass successfully:
cosmos_transfer2/_src/imaginaire/utils/checkpoint_db_test.py::test_experimental_repository_fallback PASSED [ 33%] cosmos_transfer2/_src/imaginaire/utils/checkpoint_db_test.py::test_non_experimental_repository_no_fallback PASSED [ 66%] cosmos_transfer2/_src/imaginaire/utils/checkpoint_db_test.py::test_both_repositories_fail PASSED [100%] 3 passed, 7 warnings in 0.83s