Adds support for int8 w8a8_gemlite quantization#34
Open
Conversation
lapp0
requested changes
Mar 20, 2026
examples/benchmark.py
Outdated
| # "quant": "int8_weights", | ||
| "quant": None, | ||
| "taehv_ae": True, | ||
| } |
Collaborator
There was a problem hiding this comment.
You can run with,
MODEL_URI="Overworld-Models/MR160k" pytest ./examples/benchmark.py
no need to specify all these overrides
I recommend updating MODEL_OVERRIDES
to
MODEL_OVERRIDES = [
{}, # default
{"quant": "intw8a8"},
]
examples/gen_sample.py
Outdated
|
|
||
| frame = cv2.imdecode(np.frombuffer(urllib.request.urlopen(url).read(), np.uint8), cv2.IMREAD_COLOR) | ||
| engine.append_frame(torch.from_numpy(np.repeat(frame[None], 4, axis=0))) | ||
| frame = cv2.resize(frame, (1024, 512))[:, :, ::-1] |
examples/gen_sample.py
Outdated
| device="cuda") | ||
|
|
||
| total_linear_params = sum(mod.weight.numel() for _, mod in engine.model.named_modules() if isinstance(mod, torch.nn.Linear)) | ||
| print(f"Total linear layer parameters: {total_linear_params:,}") |
Collaborator
There was a problem hiding this comment.
No need to update gen_sample.py. Could you document the available quants in a brief section in README.md though?
Author
There was a problem hiding this comment.
Got it, should quant be included by default in gen_sample.py
# Create inference engine
engine = WorldEngine(sys.argv[1], quant="intw8a8", device="cuda")
Or
# Create inference engine
engine = WorldEngine(sys.argv[1], quant=None, device="cuda")
src/quantize.py
Outdated
| try: | ||
| from lmdeploy.pytorch.models.q_modules import QLinear | ||
| except ImportError: | ||
| QLinear = None |
Collaborator
There was a problem hiding this comment.
Only gemlite works, let's only use it and call it intw8a8 or similar please.
src/world_engine.py
Outdated
| from .ae import get_ae | ||
| from .patch_model import apply_inference_patches | ||
| from .quantize import quantize_model | ||
| from .quantize import quantize_model, apply_ptq_model, apply_qat |
pyproject.toml
Outdated
| "torchvision==0.25.0", | ||
| "torchaudio==2.10.0", | ||
| "torchao==0.16.0", | ||
| "flashinfer-python==0.6.6", |
pyproject.toml
Outdated
| "torchao==0.16.0", | ||
| "flashinfer-python==0.6.6", | ||
| "fbgemm-gpu-genai==1.5.0; sys_platform == 'linux'", | ||
| "gemlite==0.5.1.post1" |
Collaborator
There was a problem hiding this comment.
Can you check if this works on Windows?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.