Skip to content

Commit e11b11f

Browse files
authored
Merge pull request #40 from FujitsuResearch/develop/v1-2-2
v1.2.2 -- bug-fix and add SECURITY.md
2 parents 70e8905 + c972e1f commit e11b11f

6 files changed

Lines changed: 74 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Change log
22

3+
## [v1.2.2] 2026-07-10
4+
5+
### Bug Fix
6+
7+
- Fixed `device="auto"` evaluation crashes in `Runner.calculate_perplexity()` and related paths by adding `ModelConfig.get_device()` and using a resolved `torch.device` for PyTorch operations such as `model.to()` and `empty_cache()`. Hugging Face `device_map="auto"` remains unchanged for model loading, but PyTorch no longer receives the raw `"auto"` string.
8+
39
## [v1.2.1] 2026-07-03
410

511
### Security
@@ -8,6 +14,7 @@
814
- **Breaking change**: existing callers of `load_quantized_model_pt()` must pass `allow_unsafe_deserialization=True` for trusted `.pt` files.
915
- **`Quantizer.load_results()` / `ResultLoader`**: same hardening applied. Loading with `weights_only=False` now requires `allow_unsafe_deserialization=True` (added as a `ResultLoader` field), and logs a warning. The safe `weights_only=True` path is unchanged.
1016
- Updated docstrings, docs, and the LoRA SFT example to document the risk and the required opt-in.
17+
- **Credit**: this unsafe deserialization issue (CWE-502) was responsibly disclosed by **Nir Yehoshua, Cipher Security Labs**. Thank you for the report.
1118

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

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,12 @@ pip install vllm
311311
See the [vLLM Inference guide](https://FujitsuResearch.github.io/OneCompression/user-guide/vllm-inference/) for details, including Open WebUI setup instructions.
312312

313313

314+
## 📬 Contact Us
315+
316+
- For technical questions and feature requests, please use GitHub [Issues](https://github.com/FujitsuResearch/OneCompression/issues).
317+
- For security vulnerabilities, please **do not** open a public Issue. See our [Security Policy](./SECURITY.md) for how to report them privately.
318+
- For collaborations, partnerships, and other inquiries, please contact us at [contact-onecompression@cs.jp.fujitsu.com](mailto:contact-onecompression@cs.jp.fujitsu.com).
319+
314320
## 📄 License
315321

316322
See [LICENSE](./LICENSE) for more details.

SECURITY.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
Security updates are provided for the latest release line of Fujitsu One Compression (OneComp).
6+
7+
| Version | Supported |
8+
| ------- | ------------------ |
9+
| 1.2.2 | :white_check_mark: |
10+
| < 1.2.2 | :x: |
11+
12+
We recommend always upgrading to the latest release before reporting an issue.
13+
14+
## Reporting a Vulnerability
15+
16+
**Please do not report security vulnerabilities through public GitHub Issues, discussions, or pull requests.**
17+
18+
Instead, report them privately by email to:
19+
20+
**[contact-onecompression@cs.jp.fujitsu.com](mailto:contact-onecompression@cs.jp.fujitsu.com)**
21+
22+
To help us triage and resolve the issue quickly, please include as much of the following as you can:
23+
24+
- The type of issue (e.g., remote code execution, information disclosure, denial of service).
25+
- The affected version(s) and, if applicable, the affected module or component.
26+
- Step-by-step instructions to reproduce the issue.
27+
- Proof-of-concept or exploit code, if available.
28+
- The potential impact of the issue, including how an attacker might exploit it.
29+
30+
## Our Commitment
31+
32+
- We will acknowledge receipt of your report within **5 business days**.
33+
- We will provide an initial assessment and expected timeline as soon as we have triaged the report.
34+
- We will keep you informed of our progress toward a fix and public disclosure.
35+
- We will credit you for the discovery unless you prefer to remain anonymous.
36+
37+
Please make a good-faith effort to avoid privacy violations, data destruction, and service interruption while investigating. We ask that you give us a reasonable amount of time to address the issue before any public disclosure.
38+
39+
Thank you for helping keep OneComp and its users safe.
40+
41+
## Security Acknowledgments
42+
43+
We thank the following researchers for responsibly disclosing security issues in OneComp:
44+
45+
- **Nir Yehoshua, Cipher Security Labs** — unsafe deserialization in `QuantizedModelLoader.load_quantized_model_pt()` (CWE-502), fixed in v1.2.1.

onecomp/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
77
"""
88

9-
__version__ = "1.2.1"
9+
__version__ = "1.2.2"

onecomp/model_config.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import torch
1212
from transformers import AutoConfig, AutoModelForCausalLM, AutoTokenizer
1313

14+
from .utils.device import get_default_device
1415
from .utils.dtype import needs_bfloat16
1516

1617
try:
@@ -114,6 +115,12 @@ def load_model(self, device_map=None):
114115
self.logger.info("Model loaded with dtype=%s", next(model.parameters()).dtype)
115116
return model
116117

118+
def get_device(self) -> torch.device:
119+
"""Return a concrete torch.device for PyTorch operations."""
120+
if self.device == "auto":
121+
return get_default_device()
122+
return torch.device(self.device)
123+
117124
def load_tokenizer(self):
118125
"""Load the tokenizer"""
119126

onecomp/runner.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ def check(self):
327327

328328
# MPS device validation: only GPTQ (or AutoBitQuantizer whose
329329
# candidates are all GPTQ, without DBF fallback) is supported on MPS
330-
device = self.model_config.device
330+
device = self.model_config.get_device()
331331
if is_mps_device(device):
332332
if self.multi_gpu:
333333
raise ValueError("multi_gpu is not supported on MPS device.")
@@ -1139,24 +1139,24 @@ def _calculate_evaluation(
11391139
tokenizer = self.model_config.load_tokenizer()
11401140
original_result = eval_function(model=model, tokenizer=tokenizer, **eval_args)
11411141
del model, tokenizer
1142-
empty_cache(self.model_config.device)
1142+
empty_cache(self.model_config.get_device())
11431143

11441144
if quantized_model:
11451145
try:
11461146
logger.info("Evaluating quantized model (%s)...", eval_name)
11471147
if self.quantized_model is not None:
11481148
model = self.quantized_model
1149-
model.to(self.model_config.device)
1149+
model.to(self.model_config.get_device())
11501150
tokenizer = self.model_config.load_tokenizer()
11511151
quantized_result = eval_function(model=model, tokenizer=tokenizer, **eval_args)
11521152
model.to("cpu")
11531153
del tokenizer
11541154
else:
11551155
model, tokenizer = self.create_quantized_model(quantizer=quantizer)
1156-
model.to(self.model_config.device)
1156+
model.to(self.model_config.get_device())
11571157
quantized_result = eval_function(model=model, tokenizer=tokenizer, **eval_args)
11581158
del model, tokenizer
1159-
empty_cache(self.model_config.device)
1159+
empty_cache(self.model_config.get_device())
11601160
except NotImplementedError:
11611161
logger.warning(
11621162
"This quantization method does not support creating a quantized model; "
@@ -1171,7 +1171,7 @@ def _calculate_evaluation(
11711171
self.update_model_weights(model, quantizer=quantizer)
11721172
dequantized_result = eval_function(model=model, tokenizer=tokenizer, **eval_args)
11731173
del model, tokenizer
1174-
empty_cache(self.model_config.device)
1174+
empty_cache(self.model_config.get_device())
11751175

11761176
return original_result, dequantized_result, quantized_result
11771177

@@ -2117,7 +2117,7 @@ def analyze_cumulative_error(
21172117
)
21182118
# Release fragmented GPU memory from previous operations (e.g., run())
21192119
gc.collect()
2120-
empty_cache(self.model_config.device)
2120+
empty_cache(self.model_config.get_device())
21212121

21222122
model = self.model_config.load_model()
21232123
input_device = next(model.parameters()).device
@@ -2141,7 +2141,7 @@ def analyze_cumulative_error(
21412141
)
21422142
# Release fragmented GPU memory from previous operations (e.g., run())
21432143
gc.collect()
2144-
empty_cache(self.model_config.device)
2144+
empty_cache(self.model_config.get_device())
21452145

21462146
model = self.model_config.load_model()
21472147
input_device = next(model.parameters()).device

0 commit comments

Comments
 (0)