Repository navigation
Conversation
- Add scripts/Primus submodule (AMD-AGI/Primus) and docker/primus.ubuntu.amd.Dockerfile - Add scripts/primus_pretrain (run.sh, get_models_json.py, extract_primus_perf.py) - Register primus_pretrain in models.json before existing primus_pyt_* entries - Un-ignore tracked perf manifests and models.json in .gitignore run.sh: resolve local submodule via ../Primus (sibling of primus_pretrain under scripts/).
There was a problem hiding this comment.
Pull request overview
Integrates Primus pretraining into the MAD/madengine workflow by adding a dedicated runner script bundle, a new Primus-based Docker image, and registering a new primus_pretrain model entry so Primus pretrain jobs can be launched consistently across environments.
Changes:
- Added
scripts/primus_pretrain/wrappers to run Primus pretrain and emitmultiple_resultsperf CSV. - Added a new
docker/primus.ubuntu.amd.Dockerfileand registeredprimus_pretraininmodels.json. - Added
scripts/Primusas a git submodule and adjusted.gitignoreto track key perf/model manifests.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
scripts/primus_pretrain/run.sh |
Wrapper to resolve Primus root/config, run pretrain, and post-process perf metrics. |
scripts/primus_pretrain/get_models_json.py |
Optional discovery of Primus configs as runnable models via globbing. |
scripts/primus_pretrain/extract_primus_perf.py |
Parses training logs and writes a multiple_results CSV. |
models.json |
Registers primus_pretrain ahead of existing Primus PyTorch training entries. |
docker/primus.ubuntu.amd.Dockerfile |
Defines a Primus image intended to bake in the Primus submodule. |
.gitmodules |
Adds the scripts/Primus submodule definition. |
.gitignore |
Stops ignoring tracked perf manifests and models.json. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- README.md: clarify Docker build and discovery notes as madengine-only; document that tools/run_models.py is unsupported for primus_pretrain due to ./docker build context incompatibility - models.json: add multiple_results: primus_perf_output.csv to primus_pretrain so the runner picks up tps/tflops/mfu from the CSV - run.sh: validate PRIMUS_ROOT path when set via env var; use set +e/-e around run_pretrain.sh so exitcode is captured correctly; fix comment on CSV row format - get_models_json.py: pass recursive=True to glob so CONFIGS_GLOB pattern matches nested YAML paths correctly Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
Aligns with the schema documented in README.md and the convention used by all other entries in models.json. Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
| if [[ -f "$LOG_PATH" ]]; then | ||
| python3 "$RUN_DIR/extract_primus_perf.py" "$LOG_PATH" "$RUN_DIR/primus_perf_output.csv" || true | ||
| fi |
# Conflicts: # docker/primus.ubuntu.amd.Dockerfile # models.json # scripts/Primus
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (5)
README.md:84
- The example command uses
--tags primus_pretrain, but there is noprimus_pretrainmodel defined in models.json (the entry isprimus_train). Users following this will get no match.
- **Run with madengine** (tags include `primus`, `training`, `pretrain`):
```bash
madengine run --tags primus_pretrain
**README.md:90**
* These references point to `scripts/primus_pretrain/...`, but the scripts directory is `scripts/primus_train` in this repo. The incorrect paths will break the docs.
- Optional discovery (madengine only):
scripts/primus_pretrain/get_models_json.pycan expose individual Primus example YAMLs as separate models when used with madengine’s discover-models flow. The legacytools/run_models.pypath is not supported forprimus_pretrain, because it builds with./dockeras context and will not satisfy this Dockerfile’s repo-rootCOPY scripts/Primus/requirement.
For more detail, see comments in docker/primus.ubuntu.amd.Dockerfile and scripts/primus_pretrain/run.sh.
**README.md:79**
* README refers to a `primus_pretrain` model entry and `scripts/primus_pretrain/`, but the repository actually defines the model as `primus_train` and the scripts live under `scripts/primus_train` (see models.json and scripts/primus_train). This mismatch will send users to a non-existent tag/path.
This issue also appears in the following locations of the same file:
- line 81
- line 88
MAD integrates AMD-AGI/Primus as a Git submodule at scripts/Primus. The primus_pretrain entry in models.json uses docker/primus.ubuntu.amd.Dockerfile and scripts/primus_pretrain/ (run.sh wraps Primus examples/run_pretrain.sh, copies logs under the madengine run directory, and writes primus_perf_output.csv for throughput / TFLOPs / MFU when logs include those metrics).
**README.md:86**
* The repo consistently uses `MAD_SECRETS_HFTOKEN` (plural) as the madengine-injected HF token env var, but this section documents `MAD_SECRET_HFTOKEN` (singular). That typo will prevent token injection.
- Hugging Face–backed configs: set
HF_TOKEN, orMAD_SECRET_HFTOKEN(madengine v2 can inject the latter viaadditional_context.docker_env_vars).
**README.md:79**
* The PR description lists adding a Primus submodule, Dockerfile, scripts, models.json registration, and .gitignore changes, but the PR content provided here only includes README.md changes. If the other files are intended to be part of this PR, they appear to be missing from the change set; otherwise the description should be updated to match what's actually changing.
Primus pretrain
MAD integrates AMD-AGI/Primus as a Git submodule at scripts/Primus. The primus_pretrain entry in models.json uses docker/primus.ubuntu.amd.Dockerfile and scripts/primus_pretrain/ (run.sh wraps Primus examples/run_pretrain.sh, copies logs under the madengine run directory, and writes primus_perf_output.csv for throughput / TFLOPs / MFU when logs include those metrics).
</details>
|
Changes were merged with #187 , closing. |
run.sh: resolve local submodule via ../Primus (sibling of primus_pretrain under scripts/).