Files
Model-Optimizer/tests/gpu
kaix-nv 9232e2fad9 [1/n] Reorganize sparsity module to separate weight and attention sparsity (#517)
## What does this PR do?

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

**Overview:** ?
Reorganizes the `modelopt/torch/sparsity` module to prepare for adding
attention sparsity support. All existing weight sparsity functionality
(source code and tests) is moved into a dedicated `weight_sparsity`
subdirectory while maintaining full backward compatibility.

```
# These imports still work exactly as before
from modelopt.torch.sparsity import sparsify, magnitude_prune
from modelopt.torch.sparsity.mode import SparsityMode
```

## 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/TensorRT-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/TensorRT-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: Kai Xu <kaix@nvidia.com>
2025-11-08 00:25:34 +05:30
..
2025-04-03 10:31:41 +05:30