Commit 3003589
authored
[Chore]: Add license for Dflash code (#1837)
### What does this PR do?
Type of change: Chore / documentation (license compliance)
The DFlash implementation in `modelopt/torch/speculative/plugins/` is
adapted from [SpecForge](https://github.com/sgl-project/SpecForge) (MIT
licensed). This PR adds the required third-party attribution per the
[Copying code from other
sources](https://github.com/NVIDIA/Model-Optimizer/blob/main/CONTRIBUTING.md#-copying-code-from-other-sources)
guidance:
- **`hf_dflash.py`** ← adapted from `specforge/core/dflash.py`
- **`modeling_dflash.py`** ← adapted from
`specforge/modeling/draft/dflash.py`
Changes:
- Add upstream attribution header (source link with commit hash +
SpecForge MIT copyright/license notice) above the NVIDIA Apache-2.0
header in both files.
- Update `SPDX-License-Identifier` to `Apache-2.0 AND MIT` in both
files.
- Add `Copyright (c) 2025 sgl-project` to the MIT section under
*Third-Party Software Notices* in `LICENSE`.
- Exclude both files from the `insert-license` pre-commit hook so the
NVIDIA header is not auto-inserted above the upstream header.
### Usage
N/A — no functional/API change (comments and license metadata only).
### Testing
- `pre-commit run insert-license-py --files <both files>` → reports
**Skipped** (files correctly excluded).
- Verified `SPDX-License-Identifier: Apache-2.0 AND MIT` is present in
both files and the upstream header precedes the NVIDIA header.
### Before your PR is "*Ready for review*"
- Is this change backward compatible?: ✅
- If you copied code from any other sources or added a new PIP
dependency, did you follow guidance in `CONTRIBUTING.md`: ✅
- Did you write any new necessary tests?: N/A
- Did you update
[Changelog](https://github.com/NVIDIA/Model-Optimizer/blob/main/CHANGELOG.rst)?:
N/A
- Did you get Claude approval on this PR?: ❌
### Additional Information
Upstream pinned at SpecForge commit `8ea5ca6`.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Chores**
* Updated third-party license notices to include an additional
attribution.
* Added license/header text to two Python modules for clearer
provenance.
* Adjusted the pre-commit configuration so those files are skipped by
the license insertion check.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Signed-off-by: h-guo18 <67671475+h-guo18@users.noreply.github.com>1 parent 7e5bd88 commit 3003589
4 files changed
Lines changed: 47 additions & 2 deletions
File tree
- modelopt/torch/speculative/plugins
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| 115 | + | |
| 116 | + | |
115 | 117 | | |
116 | 118 | | |
117 | 119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
| 249 | + | |
249 | 250 | | |
250 | 251 | | |
251 | 252 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
1 | 22 | | |
2 | | - | |
| 23 | + | |
3 | 24 | | |
4 | 25 | | |
5 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
1 | 22 | | |
2 | | - | |
| 23 | + | |
3 | 24 | | |
4 | 25 | | |
5 | 26 | | |
| |||
0 commit comments