Implement Speculative transform script for GPT models
[!IMPORTANT]
TheUpdate branchbutton must only be pressed in very rare occassions. An outdated branch is never blocking the merge of a PR. Please reach out to the automation team before pressing that button.
What does this PR do ?
Adds a conversion script to prepare a model for Speculative Decoding via Nvidia Model Optimizer.
Collection: LLM
Changelog
- Add a model-transform callable specifically for converting a given NeMo 2 model to a Model Optimizer Speculative Decoding model.
- Add a script to conveniently load an existing checkpoint, call the transform, and save the model.
Usage
python scripts/llm/gpt_speculate.py \
--model_path $CKPT_PATH \
--num_eagle_layers 1 \
--export_dir $SAVE_PATH \
llm.train(
model=model,
data=data,
trainer=trainer,
...,
model_transform=SpeculativeTransform(
num_eagle_layers=args.num_eagle_layers,
num_medusa_heads=args.num_medusa_heads,
),
)
GitHub Actions CI
The Jenkins CI system has been replaced by GitHub Actions self-hosted runners.
The GitHub Actions CI will run automatically when the "Run CICD" label is added to the PR. To re-run CI remove and add the label again. To run CI on an untrusted fork, a NeMo user with write access must first click "Approve and run".
Before your PR is "Ready for review"
Pre checks:
- [x] Make sure you read and followed Contributor guidelines
- [x] Did you write any new necessary tests?
- [ ] Did you add or update any necessary documentation?
- [ ] Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
- [ ] Reviewer: Does the PR have correct import guards for all optional libraries?
PR Type:
- [x] New Feature
- [ ] Bugfix
- [ ] Documentation
If you haven't finished some of the above items you can still open "Draft" PR.
Who can review?
Anyone in the community is free to review the PR once the checks have passed. Contributor guidelines contains specific people who can review PRs to various areas.
Additional Information
NOTE: Depends on https://github.com/NVIDIA/NeMo/pull/13599
[🤖]: Hi @AAnoosheh 👋,
We wanted to let you know that a CICD pipeline for this PR just finished successfully.
So it might be time to merge this PR or get some approvals.
//cc @chtruong814 @ko3n1g @pablo-garay @thomasdhc