Skip to content
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
139 commits
Select commit Hold shift + click to select a range
3a87452
[demo] Experimental LoRA model save/load: save base model and LoRA ad…
k-arima-3150 Apr 15, 2026
20865fb
[update] add save/load support to JointQ based on _gptq.py
S4Y-K Apr 16, 2026
23f4a6e
[update] Add script for training a LoRA model with OneCompression kno…
cm-ysmz Apr 17, 2026
2a0cf1c
Merge branch 'Branch_20865fb7' into feature/ysmz/lora-save-load-vllm-…
cm-ysmz Apr 20, 2026
d556d97
[update] Add script for training a JointQ+LoRA model with OneCompress…
cm-ysmz Apr 21, 2026
71cd666
[fix] add missing commit
cm-ysmz Apr 22, 2026
8aa8291
[refactor] revised comments and renamed methods
cm-ysmz Apr 22, 2026
4caf856
Merge pull request #11 from FujitsuResearch/develop/v1-1-0
FKKimura Apr 28, 2026
c65d7e2
Define v1.1.1
FKKimura May 7, 2026
9775761
[fix] support load of unpacked JointQ wbits=1 checkpoints
S4Y-K Apr 27, 2026
ad353f4
Merge remote-tracking branch 'remotes/origin/cm/dev' into verify/ysmz…
cm-ysmz May 8, 2026
764b98a
feat: log quantization progress with linear ETA
sotanengel May 13, 2026
ce8232d
[update] Add script for training a LoRA model with OneCompression kno…
cm-ysmz May 14, 2026
27566cf
[refactor] Delete working files
cm-ysmz May 14, 2026
3ec1166
[update] Update CHANGELOG.md (LoRA Adapter Sidecar Save/Load)
cm-ysmz May 14, 2026
7517c18
Raise clear error for unsupported QEP quantizers
FKKimura May 18, 2026
a946fa7
Merge branch 'lab/fix-jointq-qep' into 'export/v1-1-1'
FKKimura May 18, 2026
2cb598c
Merge pull request #13 from sotanengel/feature/quantization-progress-eta
FKKimura May 19, 2026
1470e5c
Refactoring: quantization progress logs with ETA (#15)
aki916f May 19, 2026
c1bc4b7
refactor(progress): tidy [progress] logs and harden tracker
FKKimura May 19, 2026
564ccfe
Merge branch 'lab/quantization_progress' into 'export/v1-1-1'
FKKimura May 19, 2026
514371c
fix(vlm): save aux files, load with correct dtype, retie tied embeddings
FKKimura May 20, 2026
c510cfe
Merge branch 'lab/issue-64-takane-vision' into 'export/v1-1-1'
FKKimura May 20, 2026
5a6d5fe
Fix tests and examples
FKKimura May 20, 2026
3a119e6
Merge branch 'lab/fix-tests-examples' into 'export/v1-1-1'
FKKimura May 20, 2026
9d97d43
Apply black
FKKimura May 20, 2026
9e784d0
Trivial-fix
FKKimura May 21, 2026
b82753b
Merge pull request #20 from FujitsuResearch/develop/v1-1-1
FKKimura May 21, 2026
0db87e6
Define v1.2.0
FKKimura May 21, 2026
7122b42
Merge branch 'cm/dev' into feature/ysmz/lora-save-load-vllm-infer_jointq
cm-ysmz May 25, 2026
3564765
Update benchmark (v1.1.1)
FKKimura May 25, 2026
bc7ac62
[fix] raise ValueError when LoRA sidecar adapters are only partially …
cm-ysmz May 25, 2026
815fd5c
Add pre-commit hooks for local development
aki916f May 25, 2026
b739b2c
Merge branch 'lab/precommit' into 'export/v1-2-0'
aki916f May 25, 2026
a510a24
[fix] resolve LoRA adapter layers by suffix when module prefixes differ
cm-ysmz May 26, 2026
0cf14bf
[chore] rename files
cm-ysmz May 26, 2026
9f5c98a
[chore] rename files
cm-ysmz May 26, 2026
49dbec4
[refactor] improve ValueError for LoRA sidecar apply failures
cm-ysmz May 26, 2026
91d4f2f
[update] Update CHANGELOG.md (v1.1.1 merge and fixes/file renames)
cm-ysmz May 26, 2026
a26e8e3
[style(onecomp)] run black formatter
k-arima-3150 May 26, 2026
20a7c68
[add] add requirements.txt for legacy-vllm environments (0.12.0/0.15.1)
cm-ysmz May 28, 2026
2f87eed
[fix] Fix requirements.txt and Add README.md (0.12.0/0.15.1)
cm-ysmz May 28, 2026
39e64e1
[fix] correctiong spelling mistakes in commands
cm-ysmz May 28, 2026
310a799
[update] Update CHANGELOG.md (legacy vllm environment)
cm-ysmz May 28, 2026
6a4496e
fix: quantizer unit test fixes and tighten GPTQ thresholds (#21)
k-arima-3150 Jun 3, 2026
b4920c3
feat: add save/load support for JointQ, RTN, and OneBit quantizers (#22)
k-arima-3150 Jun 3, 2026
ba66b76
add dashboard
aki916f Jun 4, 2026
41df7fe
Merge branch 'lab/dashboard' into 'export/v1-2-0'
aki916f Jun 4, 2026
cce8157
Merge branch 'lab/benchmark-v1-1-1' into 'export/v1-2-0'
FKKimura Jun 4, 2026
8ef90ad
Add MPS (Apple Silicon) device support (#7)
aki916 Jun 5, 2026
ee47ac9
add mt-bench and throughput evaluator
aki916f Jun 5, 2026
4fc6da2
Merge branch 'lab/mt-bench' into 'export/v1-2-0'
aki916f Jun 5, 2026
bbb8406
Add global ptq
yishii836 Jun 8, 2026
7731494
Merge branch 'lab/issue-39-global-ptq' into 'export/v1-2-0'
FKKimura Jun 8, 2026
8954b36
Do not install vllm 0.22.0 due to unsupporting exllama kernel
aki916f Jun 8, 2026
8d6a6ad
Merge branch 'lab/vllm_version' into 'export/v1-2-0'
FKKimura Jun 8, 2026
ada74d1
Merge branch 'develop/v1-2-0' into export/v1-2-0
FKKimura Jun 8, 2026
69c6c56
Apply isort and black
FKKimura Jun 8, 2026
2564db0
Update uv.lock
FKKimura Jun 8, 2026
d05d875
Modify pyproject.toml and uv.lock
FKKimura Jun 8, 2026
dcf6620
update README in dashboard
aki916f Jun 8, 2026
d9e12cc
Update docstring in examples
FKKimura Jun 8, 2026
36e6873
Bug-fix GlobalPTQDistributed to save a quantized model
FKKimura Jun 8, 2026
fe80ff9
Fix eval and dashboard for FujitsuResearch/OneCompressionn PR 23
FKKimura Jun 8, 2026
8654af0
Merge branch 'hotfix/github-pr-23' into 'export/v1-2-0'
FKKimura Jun 8, 2026
94e77ed
prevent file traversal based on input model_id (dashboard)
aki916f Jun 9, 2026
b9a7172
Merge branch 'hotfix/dashboard_path' into 'export/v1-2-0'
FKKimura Jun 9, 2026
6e83766
Merge pull request #23 from FujitsuResearch/develop/v1-2-0
FKKimura Jun 9, 2026
6ac4d07
Define v1.3.0
FKKimura Jun 9, 2026
e7e295c
Define v1.3.0
FKKimura Jun 9, 2026
3a09bf9
[fix] derive Hadamard hook target types from model instead of quant_m…
KoOhira-BP Jun 9, 2026
886fc4b
[fix]collect all down_proj types for Hadamard hooks instead of sampli…
KoOhira-BP Jun 9, 2026
0602f90
Merge remote-tracking branch 'upstream/develop/v1-3-0' into feature/y…
k-arima-3150 Jun 9, 2026
007e396
Merge remote-tracking branch 'upstream/develop/v1-3-0' into feature/y…
k-arima-3150 Jun 9, 2026
fe49076
[style] Apply pre-commit fixes
k-arima-3150 Jun 9, 2026
302cc39
[style] Apply pre-commit fixes and tidy example params/comments
k-arima-3150 Jun 10, 2026
6ef7dc5
[fix] fix LoRA SFT usage paths and changelog wording
cm-ysmz Jun 10, 2026
a4e920f
Merge remote-tracking branch 'upstream/develop/v1-3-0' into feature/y…
k-arima-3150 Jun 10, 2026
53fb66f
[fix] Restore accidentally dropped enable_lora/max_lora_rank in vLLM …
k-arima-3150 Jun 10, 2026
ba5c2fe
[fix] Discover all down_proj layer types for Hadamard hook registrati…
KoOhira-BP Jun 11, 2026
f4985f8
[fix] down_proj type collection to exclude Linear;pass use_gemlite=Fa…
KoOhira-BP Jun 12, 2026
8c676a6
[fix] Remove explicit use_gemlite=False in perplexity eval path
KoOhira-BP Jun 15, 2026
23993c8
[fix] Fail fast on ambiguous LoRA target in _resolve_name_by_layer_su…
k-arima-3150 Jun 16, 2026
580fc3e
VLM key unmatch error during quantized model load
aki916f Jun 16, 2026
92acd4a
Merge branch 'lab/vlm_error' into 'export/v1-3-0'
aki916f Jun 16, 2026
ab9aa25
fix: load generation_config.json in load_quantized_model() for Gemma-…
aki916f Jun 16, 2026
54ae95e
Merge branch 'lab/gemma4-12b' into 'export/v1-3-0'
aki916f Jun 16, 2026
ffed032
[fix] Save LoRA adapter sidecar in base model dtype instead of fixed …
k-arima-3150 Jun 16, 2026
4e16eb5
[update] Add in-place pack/unpack utilities to GPTQLinear
cm-ysmz Jun 16, 2026
b350d32
[test] Add regression tests for Hadamard hook target-type collection
KoOhira-BP Jun 16, 2026
6347b3a
[update] Make post-processes (LoRA) preserve the quantized model's pa…
cm-ysmz Jun 16, 2026
89c67b8
[fix] Export LoRA GPTQ models without rebuilding from results
cm-ysmz Jun 16, 2026
b595f85
[fix] fix comments and add LoRA tests
cm-ysmz Jun 16, 2026
c74fbae
[test] Pin down_proj hook-type collection; extract collectors to rota…
k-arima-3150 Jun 17, 2026
b6fffdf
Merge remote-tracking branch 'remotes/upstream/develop/v1-3-0' into f…
cm-ysmz Jun 17, 2026
8d8df95
Merge remote-tracking branch 'remotes/origin/feature/ysmz/lora-save-l…
cm-ysmz Jun 17, 2026
a4e2a12
[fix] fix test. align runner stubs with _collect_lora_gptq_modules an…
cm-ysmz Jun 17, 2026
d3af731
[update] Update CHANGELOG.md (v1.3.0-wip merge and LoRA/GPTQ pack upd…
cm-ysmz Jun 17, 2026
ccd49f1
Merge remote-tracking branch 'upstream/develop/v1-3-0' into fix/koohr…
k-arima-3150 Jun 18, 2026
c2478b0
[style] Apply pre-commit fixes
k-arima-3150 Jun 18, 2026
602e79c
Setup test automation and linter check corresponding to merge request
aki916f Jun 18, 2026
2cbe006
Merge branch 'lab/auto_test' into 'export/v1-3-0'
FKKimura Jun 18, 2026
b2fb676
ci: add SAST and secret detection
FKKimura Jun 18, 2026
f0c9290
Merge branch 'lab/add-sast-secret-detection' into 'export/v1-3-0'
FKKimura Jun 18, 2026
1467311
[doc] Add CHANGELOG entry for partial-quant rotation Hadamard hook ta…
k-arima-3150 Jun 18, 2026
52c0c34
[fix] fix example usage
cm-ysmz Jun 19, 2026
1b9e9a0
Merge remote-tracking branch 'upstream/develop/v1-3-0' into fix/koohr…
k-arima-3150 Jun 19, 2026
b3e51ab
add notebook for youtube
aki916f Jun 19, 2026
9e7a35c
Merge branch 'lab/notebook' into 'export/v1-3-0'
aki916f Jun 19, 2026
9f676ce
[fix] stop forcing GPTQ pack on export when pack_weights=False
cm-ysmz Jun 19, 2026
d60d7a8
Merge remote-tracking branch 'remotes/upstream/develop/v1-3-0' into f…
cm-ysmz Jun 19, 2026
6384b1a
[style] Apply black formatter
cm-ysmz Jun 19, 2026
306177b
[update] Update CHANGELOG.md (v1.3.0-wip merge into LoRA branch)
cm-ysmz Jun 19, 2026
0193645
Merge remote-tracking branch 'upstream/develop/v1-3-0' into fix/koohr…
k-arima-3150 Jun 19, 2026
ae63233
[fix] refine vLLM 0.12.0/0.15.1 setup guide
cm-ysmz Jun 26, 2026
a542924
[fix] Centralize LoRA adapter subdir constant
cm-ysmz Jun 26, 2026
b43bf53
Merge pull request #25 from computermind-corp/feature/legacy-vllm
aki916f Jun 30, 2026
3a831c3
Merge branch 'develop/v1-3-0' into feature/lora-save-load-vllm-infer_…
k-arima-3150 Jun 30, 2026
6e080ec
Merge pull request #27 from computermind-corp/feature/lora-save-load-…
aki916f Jun 30, 2026
1ba31e8
Merge remote-tracking branch 'upstream/develop/v1-3-0' into fix/koohr…
k-arima-3150 Jul 3, 2026
b9039bf
Merge pull request #30 from computermind-corp/fix/partial-quant-with-…
aki916f Jul 3, 2026
34a06e1
Merge branch 'main' into export/v1-3-0
FKKimura Jul 6, 2026
6e10f9c
Merge commit 'b9039bfc2b28a01e11d6671c9e8b19e91b7602e3' into export/v…
FKKimura Jul 6, 2026
e6c82fe
add standalone package for vllm 0.24.x with ROCm
aki916f Jul 10, 2026
698d14c
Merge branch 'lab/amd_vllm' into 'export/v1-3-0'
aki916f Jul 10, 2026
00d3856
fix seed for quantizer-test
FKKimura Jul 16, 2026
f9beba7
Merge branch 'lab/test-quip-error' into 'export/v1-3-0'
FKKimura Jul 16, 2026
8ffab54
Remove legacy LoRA examples, complete README examples list, and fix docs
FKKimura Jul 17, 2026
6dd63b0
Merge branch 'lab/delete-example' into 'export/v1-3-0'
FKKimura Jul 17, 2026
b0a246d
Support Qwen3.6 hybrid-attention blockwise calibration (#34)
dogwood-flo Jul 22, 2026
e8ebc9d
Fix silent quantized-buffer corruption in load_quantized_model() for …
dogwood-flo Jul 22, 2026
41a955d
Qwen3.6 vLLM support: add `save_format="full_wrapper"` for quantized …
dogwood-flo Jul 23, 2026
e6bceb9
Exclude `shared_expert_gate` from MoE quantization exclusion for Qwen…
dogwood-flo Jul 23, 2026
b18b6af
Merge branch 'main' into export/v1-3-0
FKKimura Jul 23, 2026
34eb0fd
Merge commit 'e6bceb9e1239b47398c6cb96569bff696e9639ad' into export/v…
FKKimura Jul 23, 2026
cc8ae30
Fix MoE expert unfuse missing on quantized model load (#38)
dogwood-flo Jul 23, 2026
7fd611b
feature: Rotation save/load + vLLM inference with TP, GemLite fallbac…
k-arima-3150 Jul 27, 2026
65a3c75
feat: Bitpack-on-quantize mode for GPTQ and DBF (#43)
k-arima-3150 Jul 30, 2026
c904feb
Enable vLLM inference for Qwen3.6-A3B GPTQ-quantized MoE models (GPTQ…
dogwood-flo Jul 31, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Change log

## [v1.3.0] 2026-MM-DD (WIP)

(TODO: Add changelog for v1.3.0)

### Bug Fix
- Fixed VLM (e.g. Gemma3) quantized model save/load: safetensors key prefixes from `save_pretrained` (`model.language_model.model.layers.*`) did not match the `from_config` model (`model.language_model.layers.*`), so `load_state_dict(..., assign=True)` left `qweight` / `scales` / `qzeros` at zero and generation degraded (`onecomp/quantized_model_loader.py`)
- Added `_remap_state_dict_keys()` to normalize checkpoint keys before `_replace_quantized_layers`; `_apply_known_state_dict_key_rewrites()` rewrites `.language_model.model.` → `.language_model.` (pattern-based, without requiring keys to exist in the empty model yet)

## [v1.2.0] 2026-06-08

### Save/Load Support for JointQ, RTN, and OneBit Quantizers
Expand Down
2 changes: 1 addition & 1 deletion onecomp/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

"""

__version__ = "1.2.0"
__version__ = "1.3.0"
104 changes: 98 additions & 6 deletions onecomp/quantized_model_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@
# Load state_dict from safetensors
state_dict = cls._load_state_dict_from_dir(save_directory)

# Align checkpoint key prefixes with the empty model built from config.
# Gemma3 VLMs are a common case: weights saved from from_pretrained
# use model.language_model.model.layers. (language_model is a
# ForCausalLM wrapper) while from_config exposes
# model.language_model.layers.* directly.
state_dict = cls._remap_state_dict_keys(state_dict, model)

# Replace quantized layers with empty modules
cls._replace_quantized_layers(model, state_dict, quant_config)

Expand Down Expand Up @@ -425,6 +432,87 @@
parent = name_to_module.get(parent_name, model)
setattr(parent, child_name, module)

@classmethod
def _remap_state_dict_keys(cls, state_dict: dict, model: torch.nn.Module) -> dict:
"""Rewrite checkpoint keys so they match model parameter paths.

Quantized models are saved from a from_pretrained instance whose
submodule naming can differ from the from_config model built at
load time. Without remapping, load_state_dict(..., assign=True)
silently skips mismatched keys and leaves layers at their empty-model
initial values (often all zeros for quantized buffers).

Remapping runs before _replace_quantized_layers, so the empty
model still exposes nn.Linear.weight rather than GPTQ buffers
(``qweight``, ``scales``, …). Known prefix rewrites are therefore
applied from checkpoint key patterns alone; they must not require the
destination key to already exist in model.named_parameters().

Args:
state_dict: Tensors loaded from *.safetensors.
model: Empty model returned by _build_empty_model_from_config.

Returns:
A new dict with keys renamed where a unique target exists in
model. Unmatched keys are kept under their original names
so strict=False loading can still proceed.
"""
model_keys = set(dict(model.named_parameters())) | set(dict(model.named_buffers()))
if not any(
cls._apply_known_state_dict_key_rewrites(key) is not None for key in state_dict
) and all(key in model_keys for key in state_dict):
return state_dict

remapped: dict = {}
rewrite_count = 0
for ckpt_key, tensor in state_dict.items():
if ckpt_key in model_keys:
remapped[ckpt_key] = tensor
continue

target_key = cls._resolve_state_dict_key(ckpt_key, model_keys)
if target_key is not None and target_key != ckpt_key:
remapped[target_key] = tensor
rewrite_count += 1
else:
remapped[ckpt_key] = tensor

if rewrite_count:
logger.info(
"Remapped %d state_dict key(s) to match model module paths",
rewrite_count,
)
return remapped

@staticmethod
def _apply_known_state_dict_key_rewrites(ckpt_key: str) -> Optional[str]:
"""Return a rewritten key for known save/load prefix drift, else None."""
if ".language_model.model." in ckpt_key:
return ckpt_key.replace(".language_model.model.", ".language_model.", 1)
if ckpt_key.startswith("language_model.model."):
return (
"model."
+ ckpt_key.replace("language_model.model.", "language_model.", 1)
)
return None

@staticmethod
def _resolve_state_dict_key(ckpt_key: str, model_keys: set) -> Optional[str]:
"""Return the remapped key for ckpt_key, or None if unknown."""
rewritten = QuantizedModelLoader._apply_known_state_dict_key_rewrites(ckpt_key)
if rewritten is not None:
return rewritten

# Suffix fallback for other prefix drift: only when the suffix maps
# uniquely onto the current model (non-quantized params/buffers).
match = re.search(r"(layers\.\d+(?:\..+)*)$", ckpt_key)

Check failure

Code scanning / CodeQL

Inefficient regular expression High

This part of the regular expression may cause exponential backtracking on strings starting with 'layers.9.' and containing many repetitions of 'a.'.
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
if match:
suffix = match.group(1)
hits = [name for name in model_keys if name.endswith(suffix)]
if len(hits) == 1:
return hits[0]
return None

@staticmethod
def _load_state_dict_from_dir(directory: str) -> dict:
"""Load all tensors from *.safetensors in *directory*.
Expand Down Expand Up @@ -521,12 +609,16 @@
suffix = m.group(1)
hits = [s for s in sd_prefix_map if s.endswith(suffix)]
if len(hits) > 1:
logger.warning(
"Ambiguous suffix %s for %s: %s",
suffix,
name,
hits,
)
lang_hits = [h for h in hits if "language_model" in h]
if len(lang_hits) == 1:
hits = lang_hits
else:
logger.warning(
"Ambiguous suffix %s for %s: %s",
suffix,
name,
hits,
)
if hits:
alt_prefix = hits[0] + "."
return {
Expand Down
Loading