Skip to content

Commit 637a22c

Browse files
authored
Merge pull request #4 from FujitsuResearch/feature/pypi
v1.0.1: Move matplotlib to visualize extra and lazy import
2 parents 4f982df + a485ae5 commit 637a22c

7 files changed

Lines changed: 34 additions & 14 deletions

File tree

CHANGELOG.md

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

3+
## [v1.0.1] 2026-03-31
4+
5+
### Packaging
6+
7+
- Moved `matplotlib` from `dev` extra to new `visualize` extra in `pyproject.toml`
8+
- Made `visualize_bit_assignment` import lazy in `onecomp/quantizer/autobit/__init__.py` to avoid requiring matplotlib at import time
9+
- Updated installation instructions in `README.md` and `docs/getting-started/installation.md` to reflect the new `visualize` extra
10+
- Updated `uv.lock`
11+
312
## [v1.0.0] 2026-03-31
413

514
### PyPI Publishing Setup

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ With its Rust-based dependency resolver and the `uv.lock` lockfile, uv provides
8989
# install uv (for macOS or Linux)
9090
curl -LsSf https://astral.sh/uv/install.sh | sh
9191

92-
git clone <git repository URL>
92+
git clone https://github.com/FujitsuResearch/OneCompression.git
9393
cd OneCompression
94-
uv sync --extra cu128 --extra dev
94+
uv sync --extra cu128 --extra dev --extra visualize
9595
```
9696

9797
The `uv sync` command creates a Python virtual environment and installs all dependent libraries.
@@ -100,12 +100,13 @@ The `--extra cu128` option installs the CUDA-enabled version of PyTorch (along w
100100
Replace `cu128` with the appropriate variant for your environment: `cpu`, `cu118`, `cu121`, `cu124`, `cu126`, or `cu128`.
101101
PyTorch will be automatically downloaded by `uv`, so you do not need to install it beforehand.
102102

103-
Adding `--extra dev` installs additional packages for development.
103+
Adding `--extra dev` installs development tools (black, pytest, pylint).
104+
Adding `--extra visualize` installs matplotlib for visualization features.
104105

105106
To use vLLM for serving quantized models, add `--extra vllm`:
106107

107108
```bash
108-
uv sync --extra cu128 --extra dev --extra vllm
109+
uv sync --extra cu128 --extra dev --extra visualize --extra vllm
109110
```
110111

111112
> **Note:** `--extra vllm` may take a long time on the first run if a pre-built `xformers` wheel is not available for your Python/CUDA combination (e.g. Python 3.13). Using Python 3.12 typically avoids this.

docs/getting-started/installation.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,13 @@ print(torch.cuda.is_available())
6767
### Step 2: Install OneComp
6868

6969
```bash
70-
pip install git+https://github.com/FujitsuResearch/OneCompression.git
70+
pip install onecomp
71+
```
72+
73+
To enable visualization features (matplotlib), install with the `visualize` extra:
74+
75+
```bash
76+
pip install onecomp[visualize]
7177
```
7278

7379
## For Developers (uv -- recommended)
@@ -82,18 +88,19 @@ curl -LsSf https://astral.sh/uv/install.sh | sh
8288
# Clone and set up
8389
git clone https://github.com/FujitsuResearch/OneCompression.git
8490
cd OneCompression
85-
uv sync --extra cu128 --extra dev
91+
uv sync --extra cu128 --extra dev --extra visualize
8692
```
8793

8894
The `uv sync` command creates a virtual environment and installs all dependencies (including `torchvision` from the same CUDA index as PyTorch).
8995
Replace `cu128` with the appropriate CUDA variant for your system: `cpu`, `cu118`, `cu121`, `cu124`, `cu126`, or `cu128`.
9096

91-
Adding `--extra dev` installs development tools (black, pytest, pylint, matplotlib).
97+
Adding `--extra dev` installs development tools (black, pytest, pylint).
98+
Adding `--extra visualize` installs matplotlib for visualization features.
9299

93100
To use vLLM for serving quantized models, add `--extra vllm`:
94101

95102
```bash
96-
uv sync --extra cu128 --extra dev --extra vllm
103+
uv sync --extra cu128 --extra dev --extra visualize --extra vllm
97104
```
98105

99106
!!! warning

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.0.0"
9+
__version__ = "1.0.1"

onecomp/quantizer/autobit/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"""
88

99
from ._autobit import AutoBitQuantizer, AssignmentStrategy
10-
from .visualize import visualize_bit_assignment
1110
from .ilp import assign_by_ilp
1211
from .manual import assign_manually
1312
from .dbf_fallback import inject_dbf

pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,12 @@ cu126 = ["torch", "torchvision"]
5454
cu128 = ["torch", "torchvision"]
5555
dev = [
5656
"black",
57-
"matplotlib>=3.10.8",
5857
"pylint",
5958
"pytest",
6059
]
60+
visualize = [
61+
"matplotlib>=3.10.8",
62+
]
6163
vllm = ["vllm"]
6264
docs = [
6365
"mkdocs-material",

uv.lock

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)