[BUGFIX] Stabilize the default test suite and bugfixes - #46
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b307d8491e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
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.
Summary
This PR brings the seven commits on
bugfix/upgrade-test-suiteintodevelop. It fixesSaveModelwhen a caller passestorch.device, defines the default pytest selection policy, and removes scripts and placeholders that pytest was collecting as tests.Main changes
Runtime Fix
SaveModel(..., target_device=...)now accepts either a device string ortorch.deviceand normalizes the value throughtorch.devicebefore deriving the filename-safe device suffix. The regression test saves a state dictionary withtarget_device=torch.device("cpu")and covers theModelTrainingManagercall path that previously failed while formatting the device name.Pytest Selection and CUDA Gating
tests/conftest.pyadds--run-slow,--run-gpu, and--run-visual; tests carrying those markers are skipped unless the corresponding option is present. The shared CUDA helper now executes and synchronizes a small CUDA operation instead of treating device discovery as proof that the runtime works, whileRequireCudaUsable()lets dependent tests skip cleanly when kernels cannot execute. The training-manager integration test is marked slow, GPU-dependent, and integration-level. Dataset visualization, external-dataset loading, augmentation timing, and image-operator tests are marked according to their runtime requirements, and the EfficientNet ONNX check uses the existingexportmarker.Test Rework and Cleanup
The manually launched TCP server script is replaced with terminating pytest coverage for a
DataProcessortensor round trip and an ephemeral-port server startup and shutdown. Timing tests patch the performance counter instead of callingsleep(), then verify wrapped return values, call counts, function metadata, positional arguments, and keyword arguments. The CIFAR-10 MLflow/Optuna workflow moves fromtests/hparams_optim/test_mlflow_with_optuna.pytoexamples/example_mlflow_optuna_cifar10_demo.pybecause it downloads data, runs up to 100 trials, and may start external tracking services. Three files with no executable assertions are removed:test_torch_model_over_tcp.py,test_ModelExplainer.py, andtest_TorchModel.py. Thetestsdirectory is now an importable support package for the shared CUDA helpers.Testing and Validation
Local validation passed with 655 tests passed and 74 skipped through
./run_tests.sh -- -qin the Python 3.11autoforgeenvironment, and with 657 passed and 72 skipped throughpython -m pytest -qin the Python 3.12autoforgeV2environment. The two ONNX pooling export tests that previously failed inautoforgealso passed. The local Python 3.11 environment was updated fromonnxscript 0.2.0toonnxscript 0.7.1, which installedonnx-ir 1.0.0and provides thetorch_2_11exporter adapter required by PyTorch 2.11; this PR does not change an environment or dependency file.Remote CI Status
Manual workflow run 34027009331 passed package build and installation. The pytest job collected all 729 tests and reported 651 passed, 74 skipped, and 4 failed because
DATASETSis not defined on the runner; all four failures are in unchangedtests/datasets/test_DatasetClasses.py. The lint job reported 23 existingF821errors, none in paths changed by this PR. The workflow does not run automatically for this PR because it still filters pull requests tomainand the retireddev_mainbranch instead ofdevelop.Compatibility and Review Notes
String-valued
target_devicecalls keep their existing behavior. Slow, GPU, and visual tests now require explicit pytest flags, so default validation does not cover GPU, visual, or external-dataset execution. The moved CIFAR-10 example remains a long-running, networked demonstration but is no longer part of pytest collection. Reviewers should confirm that each deleted placeholder is empty or replaced by the behavior-focused coverage described above, and should readtests/conftest.pywithtests/helpers.pybecause those files jointly define the opt-in marker policy and CUDA runtime check.