Commit Graph
9 Commits
Author SHA1 Message Date
Asha Anoosheh 510451322c Streamline KD & QAD transformers Trainers (#708)
## What does this PR do?

**Type of change:** ? Refactor and stabilization

**Overview:** 
* Enforce use of FSDP-2 on KD and QAD trainers in HF plugins/examples so
that we can remove multiple restrictions

## Usage
<!-- You can potentially add a usage example below. -->

```python
# Add a code snippet demonstrating how to use this
```

## Testing
<!-- Mention how have you tested your change if applicable. -->

## Before your PR is "*Ready for review*"
<!-- If you haven't finished some of the above items you can still open
`Draft` PR. -->

- **Make sure you read and follow [Contributor
guidelines](https://github.com/NVIDIA/Model-Optimizer/blob/main/CONTRIBUTING.md)**
and your commits are signed.
- **Is this change backward compatible?**: Yes/No <!--- If No, explain
why. -->
- **Did you write any new necessary tests?**: Yes/No
- **Did you add or update any necessary documentation?**: Yes/No
- **Did you update
[Changelog](https://github.com/NVIDIA/Model-Optimizer/blob/main/CHANGELOG.rst)?**:
Yes/No <!--- Only for new features, API changes, critical bug fixes or
bw breaking changes. -->

## Additional Information
<!-- E.g. related issue. -->

---------

Signed-off-by: Asha Anoosheh <aanoosheh@nvidia.com>
2026-01-10 01:28:56 +00:00
Keval Morabia 1562dd617e Make torchprofile dependency optional
Signed-off-by: Keval Morabia <28916987+kevalmorabia97@users.noreply.github.com>
2025-12-17 05:36:06 -08:00
Riyad Islam c3f6cef87e ONNX save fix (#496)
## What does this PR do?

**Type of change:** Bug <!-- Use one of the following: Bug fix, new
feature, new example, new tests, documentation. -->

**Overview:** `get_onnx_bytes` api is error prone as it returns only the
protobuf info. If model has any external data, they get discarded! We
have to use `get_onnx_bytes_and_metadata` and provide example for users
to correctly write ONNX model to disk.

## Usage
This would be proper way to save ONNX model bytes with/without external
data.
```python
    onnx_bytes, _ = get_onnx_bytes_and_metadata(
        model=model,
        dummy_input=(input_tensor,),
        weights_dtype=weights_dtype,
        model_name=model_name,
    )
    onnx_bytes_obj = OnnxBytes.from_bytes(onnx_bytes)

    # Write the onnx model to the specified directory without cleaning it
    onnx_bytes_obj.write_to_disk(os.path.dirname(onnx_save_path), clean_dir=False)
```

## Testing
N/A. Existing tests are modified.

## Before your PR is "*Ready for review*"
<!-- If you haven't finished some of the above items you can still open
`Draft` PR. -->

- **Make sure you read and follow [Contributor
guidelines](https://github.com/NVIDIA/TensorRT-Model-Optimizer/blob/main/CONTRIBUTING.md)**
and your commits are signed.
- **Is this change backward compatible?**: Yes <!--- If No, explain why.
-->
- **Did you write any new necessary tests?**: Yes
- **Did you add or update any necessary documentation?**: Yes
- **Did you update
[Changelog](https://github.com/NVIDIA/TensorRT-Model-Optimizer/blob/main/CHANGELOG.rst)?**:
Yes<!--- Only for new features, API changes, critical bug fixes or bw
breaking changes. -->

## Additional Information
https://nvbugspro.nvidia.com/bug/5618246/4

Signed-off-by: Riyad Islam <rislam@nvidia.com>
2025-11-05 09:18:56 +05:30
Keval Morabia 1ef1d72a1b Code quality improvements - typos, formatting, etc.
Signed-off-by: Keval Morabia <28916987+kevalmorabia97@users.noreply.github.com>
2025-09-02 19:58:33 +05:30
Keval Morabia d09c82779c Push latest changes and bug fixes (#274)
Signed-off-by: Keval Morabia <28916987+kevalmorabia97@users.noreply.github.com>
2025-08-29 17:29:52 +05:30
Keval Morabia cafa7f60ed Update for 0.33.0 release 2025-07-14 23:08:26 +05:30
Keval Morabia 7af33d29ce Update for 0.31.0 release 2025-06-05 13:24:07 -07:00
Keval Morabia 7a047435ae Update for 0.29.0 release 2025-05-08 23:43:51 +05:30
Keval Morabia 73d6af785f Update 0.23.0 - OSS release 2025-01-29 01:45:47 +05:30