Skip to content

Commit 54dc838

Browse files
Merge branch 'NVIDIA:main' into main
2 parents 477ee77 + 952a62b commit 54dc838

101 files changed

Lines changed: 6626 additions & 474 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,6 @@ modelopt_recipes @NVIDIA/modelopt-recipes-codeowners
5555
/examples/vlm_ptq @NVIDIA/modelopt-examples-vlm-codeowners
5656
/examples/vllm_serve @NVIDIA/modelopt-examples-llm_ptq-codeowners
5757
/examples/windows @NVIDIA/modelopt-windows-codeowners
58+
59+
# Requirements files are owned by the setup team regardless of location
60+
requirements*.txt @NVIDIA/modelopt-setup-codeowners

.github/workflows/gpu_tests.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ jobs:
4242
.github/workflows/gpu_tests.yml
4343
modelopt/**
4444
tests/gpu/**
45+
tests/gpu_regression/**
46+
examples/speculative_decoding/**
47+
examples/dataset/**
48+
modelopt_recipes/general/speculative_decoding/**
49+
tools/launcher/**
4550
pyproject.toml
4651
tox.ini
4752
fail_on_initial_diff_error: true
@@ -66,6 +71,9 @@ jobs:
6671
timeout: 45
6772
container_image: pytorch:26.01-py3
6873
# tests/gpu/_extensions/test_onnx_extensions.py fails for newer containers until https://github.com/tbenthompson/cppimport/pull/98
74+
- example: gpu-regression
75+
timeout: 15
76+
container_image: pytorch:26.01-py3
6977
- example: gpu-megatron
7078
timeout: 45
7179
container_image: pytorch:26.01-py3

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ repos:
5757

5858
- repo: local
5959
hooks:
60+
- id: normalize-yaml-ext
61+
name: normalize .yml to .yaml in required places, right now only yaml files in modelopt_recipes
62+
entry: python tools/precommit/normalize_yaml_ext.py
63+
language: system
64+
files: ^modelopt_recipes/.*\.yml$
65+
6066
- id: check-modelopt-recipes
6167
name: validate modelopt recipes
6268
entry: python tools/precommit/check_modelopt_recipes.py

CONTRIBUTING.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
Thanks for your interest in contributing to Model Optimizer (ModelOpt)!
44

5+
> [!NOTE]
6+
> Any contributions to this repository are only accepted under the Apache 2.0 license.
7+
58
## 🛠️ Setting up your environment
69

710
Ensure that Model Optimizer (ModelOpt) is installed in editable mode and that all `dev` optional requirements are installed:
@@ -64,11 +67,18 @@ If you are an external contributor, seek guidance from `@NVIDIA/modelopt-setup-c
6467
1. A reference link (with commit hash) to the source from which the code was copied.
6568
1. The original repository's Copyright / License.
6669
1. The NVIDIA Apache 2.0 Copyright / License header.
70+
- **Update `SPDX-License-Identifier`:** If the third-party code uses a different license than Apache 2.0, update the `SPDX-License-Identifier` in the NVIDIA header to reflect both licenses using SPDX expression syntax. For example, for MIT-licensed source code:
71+
72+
```python
73+
# SPDX-License-Identifier: Apache-2.0 AND MIT
74+
```
6775

68-
See [`modelopt/torch/speculative/eagle/utils.py`](./modelopt/torch/speculative/eagle/utils.py)
69-
for an example of the correct license header format.
76+
If the third-party code is also Apache 2.0, no change is needed (`SPDX-License-Identifier: Apache-2.0` remains correct).
77+
- **Update `LICENSE`:** Add the third-party copyright holder to the appropriate license section in the [`LICENSE`](./LICENSE) file under *Third-Party Software Notices*. If the third-party license is not already listed there, add a new section with the full license text.
7078
- **Exclude from license pre-commit hook:** Exclude copied files from the license pre-commit hook so it doesn't auto-add the NVIDIA Apache 2.0 license on top of the file. Add the file path to the `exclude` list in the `insert-license` hook in [`.pre-commit-config.yaml`](./.pre-commit-config.yaml).
7179

80+
See [`modelopt/torch/quantization/utils/calib_utils.py`](./modelopt/torch/quantization/utils/calib_utils.py) for an example of the correct license header format.
81+
7282
## 📝 Writing tests
7383

7484
We use [pytest](https://docs.pytest.org/) for all tests. For any new features / examples, make sure to add tests and that the coverage check in your PR passes. The tests are organized into the following directories:

LICENSE

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,3 +199,119 @@
199199
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200200
See the License for the specific language governing permissions and
201201
limitations under the License.
202+
203+
================================================================================
204+
Third-Party Software Notices
205+
================================================================================
206+
207+
Portions of this repository contain code adapted from third-party sources.
208+
Each component is subject to the terms of its respective license as set out
209+
below.
210+
211+
--------------------------------------------------------------------------------
212+
Apache License, Version 2.0
213+
--------------------------------------------------------------------------------
214+
215+
Portions of this repository were adapted from code originally authored by
216+
the following copyright holders, licensed under the Apache License, Version 2.0
217+
(see full license text above):
218+
219+
Copyright 2021 The HuggingFace Inc. team
220+
Copyright 2022 The HuggingFace Team
221+
Copyright 2022, Lefebvre Dalloz Services
222+
Copyright 2022 EleutherAI and the HuggingFace Inc. team
223+
Copyright 2023 Rohan Taori, Ishaan Gulrajani, Tianyi Zhang, Yann Dubois, Xuechen Li
224+
Copyright (c) 2024 Heming Xia
225+
Copyright 2025 The Qwen team, Alibaba Group and the HuggingFace Inc. team
226+
227+
Licensed under the Apache License, Version 2.0 (the "License"); you may not
228+
use these files except in compliance with the License. You may obtain a copy
229+
of the License at http://www.apache.org/licenses/LICENSE-2.0
230+
231+
Unless required by applicable law or agreed to in writing, software distributed
232+
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
233+
CONDITIONS OF ANY KIND, either express or implied. See the License for the
234+
specific language governing permissions and limitations under the License.
235+
236+
--------------------------------------------------------------------------------
237+
MIT License
238+
--------------------------------------------------------------------------------
239+
240+
Portions of this repository were adapted from code originally authored by
241+
the following copyright holders, licensed under the MIT License:
242+
243+
Copyright (c) Andrei Panferov
244+
Copyright (c) Microsoft Corporation
245+
Copyright (c) 2020 EleutherAI
246+
Copyright (c) 2020 Dan Hendrycks
247+
Copyright (c) 2023 Deep Cognition and Language Research (DeCLaRe) Lab
248+
Copyright (c) 2023 DeepSeek
249+
250+
Permission is hereby granted, free of charge, to any person obtaining a copy
251+
of this software and associated documentation files (the "Software"), to deal
252+
in the Software without restriction, including without limitation the rights
253+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
254+
copies of the Software, and to permit persons to whom the Software is
255+
furnished to do so, subject to the following conditions:
256+
257+
The above copyright notice and this permission notice shall be included in all
258+
copies or substantial portions of the Software.
259+
260+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
261+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
262+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
263+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
264+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
265+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
266+
SOFTWARE.
267+
268+
--------------------------------------------------------------------------------
269+
BSD 3-Clause License
270+
--------------------------------------------------------------------------------
271+
272+
Portions of this repository were adapted from code originally authored by
273+
the following copyright holders, licensed under the BSD 3-Clause License:
274+
275+
Copyright (c) 2016- Facebook, Inc (Adam Paszke)
276+
Copyright (c) 2014- Facebook, Inc (Soumith Chintala)
277+
Copyright (c) 2011-2014 Idiap Research Institute (Ronan Collobert)
278+
Copyright (c) 2012-2014 Deepmind Technologies (Koray Kavukcuoglu)
279+
Copyright (c) 2011-2012 NEC Laboratories America (Koray Kavukcuoglu)
280+
Copyright (c) 2011-2013 NYU (Clement Farabet)
281+
Copyright (c) 2006-2010 NEC Laboratories America (Ronan Collobert, Leon Bottou, Iain Melvin, Jason Weston)
282+
Copyright (c) 2006 Idiap Research Institute (Samy Bengio)
283+
Copyright (c) 2001-2004 Idiap Research Institute (Ronan Collobert, Samy Bengio, Johnny Mariethoz)
284+
Copyright (c) 2016-present, Facebook Inc.
285+
Copyright (c) 2016 Facebook Inc.
286+
Copyright (c) 2015 Google Inc.
287+
Copyright (c) 2015 Yangqing Jia
288+
Copyright 2019-2020 Kakao Brain
289+
Copyright (c) 2022 Cruise LLC.
290+
Copyright (c) 2024 Tri Dao.
291+
Copyright (c) 2021, 2023-2024 Arm Limited and/or its affiliates
292+
293+
Redistribution and use in source and binary forms, with or without
294+
modification, are permitted provided that the following conditions are met:
295+
296+
1. Redistributions of source code must retain the above copyright notice,
297+
this list of conditions and the following disclaimer.
298+
299+
2. Redistributions in binary form must reproduce the above copyright notice,
300+
this list of conditions and the following disclaimer in the documentation
301+
and/or other materials provided with the distribution.
302+
303+
3. Neither the names of Facebook, Deepmind Technologies, NYU, NEC Laboratories
304+
America and IDIAP Research Institute nor the names of its contributors may
305+
be used to endorse or promote products derived from this software without
306+
specific prior written permission.
307+
308+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
309+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
310+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
311+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
312+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
313+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
314+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
315+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
316+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
317+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

0 commit comments

Comments
 (0)