Skip to content

Commit f7448d2

Browse files
authored
Merge branch 'main' into torch-compile-observers
2 parents 876aaab + d0ce1d8 commit f7448d2

File tree

23 files changed

+575
-511
lines changed

23 files changed

+575
-511
lines changed

docs/developer/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ LLM Compressor is an open-source project that values community contributions. We
1414

1515
Our community guidelines ensure that participation in the LLM Compressor project is a positive, inclusive, and respectful experience for everyone.
1616

17-
[:octicons-arrow-right-24: Code of Conduct](code-of-conduct.md)
17+
[:octicons-arrow-right-24: Code of Conduct](../../CODE_OF_CONDUCT.md)
1818

1919
- :material-source-pull:{ .lg .middle } Contributing Guide
2020

2121
---
2222

2323
Learn how to effectively contribute to LLM Compressor, including reporting bugs, suggesting features, improving documentation, and submitting code.
2424

25-
[:octicons-arrow-right-24: Contributing Guide](contributing.md)
25+
[:octicons-arrow-right-24: Contributing Guide](../../CONTRIBUTING.md)
2626

2727
</div>

examples/big_models_with_sequential_onloading/llama3.3_70b.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from llmcompressor import oneshot
66
from llmcompressor.modifiers.quantization import GPTQModifier
7-
from llmcompressor.modifiers.smoothquant import SmoothQuantModifier
7+
from llmcompressor.modifiers.transform.smoothquant import SmoothQuantModifier
88

99
# Select model and load it.
1010
model_id = "meta-llama/Llama-3.3-70B-Instruct"

examples/multimodal_audio/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Sequential targets are the modules which determine the granularity of error prop
4444
Choosing sequential targets with higher granularity (for example "Linear" instead of "LlamaDecoderLayer") will result in fewer hessians being allocated at the same time, decreasing the memory requirements for compression. This may also increase the recovered accuracy of the model, as compression error is propagated at a higher granularity. However, using higher granularity sequential targets may also increase compression time, as more time is spent offloading and onloading activations.
4545

4646
## Adding Your Own Smoothquant Mappings ##
47-
For a guide on adding smoothquant mappings for your dataset, see the [SmoothQuant Guide](/src/llmcompressor/modifiers/smoothquant/README.md).
47+
For a guide on adding smoothquant mappings for your dataset, see the [SmoothQuant Guide](/src/llmcompressor/modifiers/transform/smoothquant/README.md).
4848

4949
## Adding Your Own Data Collator ##
5050
Most examples utilize a generic `data_collator` which correctly correlates data for most multimodal datasets. If you find that your model needs custom data collation (as is the case with [pixtral](/examples/multimodal_vision/pixtral_example.py)), you can modify this function to reflect these model-specific requirements.

examples/multimodal_vision/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Sequential targets are the modules which determine the granularity of error prop
4848
Choosing sequential targets with higher granularity (for example "Linear" instead of "LlamaDecoderLayer") will result in fewer hessians being allocated at the same time, decreasing the memory requirements for compression. This may also increase the recovered accuracy of the model, as compression error is propagated at a higher granularity. However, using higher granularity sequential targets may also increase compression time, as more time is spent offloading and onloading activations.
4949

5050
## Adding Your Own Smoothquant Mappings ##
51-
For a guide on adding smoothquant mappings for your dataset, see the [SmoothQuant Guide](/src/llmcompressor/modifiers/smoothquant/README.md).
51+
For a guide on adding smoothquant mappings for your dataset, see the [SmoothQuant Guide](/src/llmcompressor/modifiers/transform/smoothquant/README.md).
5252

5353
## Adding Your Own Data Collator ##
5454
Most examples utilize a generic `data_collator` which correctly correlates data for most multimodal datasets. If you find that your model needs custom data collation (as is the case with [pixtral](/examples/multimodal_vision/pixtral_example.py)), you can modify this function to reflect these model-specific requirements.

examples/quantization_w8a8_int8/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ We first select the quantization algorithm. For W8A8, we want to:
8686
```python
8787
from llmcompressor import oneshot
8888
from llmcompressor.modifiers.quantization import GPTQModifier
89-
from llmcompressor.modifiers.smoothquant import SmoothQuantModifier
89+
from llmcompressor.modifiers.transform.smoothquant import SmoothQuantModifier
9090

9191
# Configure the quantization algorithms to run.
9292
recipe = [

examples/quantization_w8a8_int8/llama3_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from llmcompressor import oneshot
66
from llmcompressor.modifiers.quantization import GPTQModifier
7-
from llmcompressor.modifiers.smoothquant import SmoothQuantModifier
7+
from llmcompressor.modifiers.transform.smoothquant import SmoothQuantModifier
88

99
# Select model and load it.
1010
MODEL_ID = "meta-llama/Meta-Llama-3-8B-Instruct"

src/llmcompressor/modifiers/logarithmic_equalization/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import torch
22
from torch.nn import Module
33

4-
from llmcompressor.modifiers.smoothquant import SmoothQuantModifier
4+
from llmcompressor.modifiers.transform.smoothquant import SmoothQuantModifier
55

66
__all__ = ["LogarithmicEqualizationModifier"]
77

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
11
# ruff: noqa
2+
"""
3+
Backwards compatibility shim for SmoothQuantModifier.
24
3-
from .base import *
5+
This module has been moved to llmcompressor.modifiers.transform.smoothquant.
6+
This shim will be removed in a future version.
7+
"""
8+
9+
import warnings
10+
11+
warnings.warn(
12+
"Importing from 'llmcompressor.modifiers.smoothquant' is deprecated. "
13+
"Please update your imports to use 'llmcompressor.modifiers.transform.smoothquant' "
14+
"or 'llmcompressor.modifiers.transform' instead. "
15+
"This compatibility shim will be removed in a future version.",
16+
DeprecationWarning,
17+
stacklevel=2,
18+
)
19+
20+
from llmcompressor.modifiers.transform.smoothquant import *
21+
from llmcompressor.modifiers.transform.smoothquant.base import SmoothQuantModifier
22+
23+
__all__ = ["SmoothQuantModifier"]

0 commit comments

Comments
 (0)