{"data":{"slug":"fujitsuresearch-onecompression","name":"OneCompression","tagline":"Python package for LLM compression","github_url":"https://github.com/FujitsuResearch/OneCompression","owner":"FujitsuResearch","repo":"OneCompression","owner_avatar_url":"https://avatars.githubusercontent.com/u/89898454?v=4","primary_language":"Python","stars":396,"forks":18,"topics":["llm","qep","quantization","vllm"],"archived":false,"github_pushed_at":"2026-07-06T07:39:46+00:00","maintenance_label":"Very active","url":"https://www.graphcanon.com/tools/fujitsuresearch-onecompression","markdown_url":"https://www.graphcanon.com/tools/fujitsuresearch-onecompression.md","api_url":"https://www.graphcanon.com/api/graphcanon/tools/fujitsuresearch-onecompression","graph_url":"https://www.graphcanon.com/api/graphcanon/graph?tool=fujitsuresearch-onecompression","description":"Python package for LLM compression","homepage_url":"https://fujitsuresearch.github.io/OneCompression/","license":"MIT","open_issues":6,"watchers":4,"ai_summary":null,"readme_excerpt":"# install uv (for macOS or Linux)\ncurl -LsSf https://astral.sh/uv/install.sh | sh\n\ngit clone https://github.com/FujitsuResearch/OneCompression.git\ncd OneCompression\n```\n\nThe `uv sync` command creates a Python virtual environment and installs all dependent libraries.\n\n#### Linux (CUDA quantization / vLLM)\n\n```bash\nuv sync --extra cu128 --extra dev --extra visualize\n```\n\nThe `--extra cu128` option installs the CUDA-enabled version of PyTorch (along with `torchvision` from the same CUDA index).\nReplace `cu128` with the appropriate variant for your environment: `cpu`, `cu118`, `cu121`, `cu124`, `cu126`, `cu128`, or `cu130`.\nPyTorch will be automatically downloaded by `uv`, so you do not need to install it beforehand.\n\n#### macOS (development / MPS inference)\n\n```bash\nuv sync --extra mps --extra dev --extra visualize\n```\n\nOn macOS, use `--extra mps` only. CUDA extras (`cu118`–`cu130`), `--extra cpu` (Linux-only), and `--extra vllm` are not supported on macOS.\nAfter `uv sync`, you can run GPTQ quantization and Hugging Face `generate()` inference on MPS; vLLM serving still requires Linux with an NVIDIA GPU.\nSee the **MPS device placement (GPTQ vs QEP)** note under [macOS (MPS)](#macos-mps) above for why GPTQ runs on CPU while QEP correction uses MPS.\n\nAdding `--extra dev` installs development tools (black, pre-commit, pytest, pylint).\nAdding `--extra visualize` installs matplotlib for visualization features.\nAdding `--extra distributed` installs DeepSpeed for multi-GPU training.\nAdding `--extra hydra` installs `hydra-core` for the example scripts and `model_validation/` runners that use Hydra-based configuration.\n\nTo use vLLM for serving quantized models on Linux, add `--extra vllm` together with `--extra cu130`:\n\n```bash\nuv sync --extra cu130 --extra dev --extra visualize --extra vllm\n```\n\n> **Note:** `--extra vllm` is only compatible with `--extra cu130`. Recent vLLM releases require `torch>=2.10`, whose wheels are only published for the `cu130` index. Combining `--extra vllm` with `cpu` / `mps` / `cu118` / `cu121` / `cu124` / `cu126` / `cu128` is rejected by `uv` at lock time.\n\n> **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.\n\n#### Running commands (uv environment)\n\nIn the environment created by `uv sync`, you can run commands in two ways:\n\n##### Option 1: Use `uv run` (no activation needed)\n\n```bash\nuv run pytest tests/ -v\nuv run python example/example_gptq.py\nuv run black --check onecomp/\n```\n\n##### Option 2: Activate the virtual environment (traditional approach)\n\n```bash\nsource .venv/bin/activate\npytest tests/ -v\npython example/example_gptq.py\nblack --check onecomp/\n```\n\n---\n\n# First, install PyTorch with CUDA support for your environment\npip install torch --index-url https://download.pytorch.org/whl/cu128\n\n---\n\n# Then install onecomp with development dependencies\npip install -e \".[dev]\"\n```\n\nReplace `cu128` with the appropriate variant for your environment: `cpu`, `cu118`, `cu121`, `cu124`, `cu126`, `cu128`, or `cu130`.\n\n#### Pre-commit\n\nAfter installing development dependencies (`--extra dev` with uv, or `pip install -e \".[dev]\"` with pip), register the Git hooks once:\n\n```bash\npre-commit install\n```\n\nOn every `git commit`, the following checks run automatically:\n\n| Hook | Description |\n|------|-------------|\n| **black** | Code formatting (line length 99) |\n| **isort** | Import sorting |\n| **no-japanese** | Forbid Japanese characters in text files (`.md` and `.gitignore` are excluded) |\n| **copyright-header** | Verify the Fujitsu copyright header in Python files |\n| **no-email-address** | Forbid email addresses in Python files |\n\nCommon commands:\n\n```bash\n\n---\n\n# Run hooks on all files (useful after first install or config changes)\npre-commit run --all-files\n\n---\n\n# uv users (vLLM requires cu130; see Installation for details)\nuv sync --extra cu130 --extra vllm\n\n---\n\n##","github_created_at":"2026-03-30T10:30:14+00:00","created_at":"2026-07-11T23:10:28.183429+00:00","updated_at":"2026-07-12T03:21:57.814313+00:00","categories":[{"slug":"llm-frameworks","name":"LLM Frameworks","url":"https://www.graphcanon.com/categories/llm-frameworks","markdown_url":"https://www.graphcanon.com/categories/llm-frameworks.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/llm-frameworks"},{"slug":"model-training","name":"Model Training","url":"https://www.graphcanon.com/categories/model-training","markdown_url":"https://www.graphcanon.com/categories/model-training.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/model-training"},{"slug":"inference-serving","name":"Inference & Serving","url":"https://www.graphcanon.com/categories/inference-serving","markdown_url":"https://www.graphcanon.com/categories/inference-serving.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/inference-serving"}],"tags":[{"slug":"qep","name":"qep"},{"slug":"llm","name":"llm"},{"slug":"vllm","name":"vllm"},{"slug":"python","name":"python"},{"slug":"quantization","name":"quantization"}],"trust":{"provenance":{"is_fork":false,"github_id":1196059417,"owner_type":"Organization","methodology":"github_public_v1","parent_repo":null,"near_duplicate_slugs":[]},"computed_at":"2026-07-11T23:10:30.483Z","maintenance":{"label":"Very active","score":96,"methodology":"github_public_v1","releases_90d":4,"days_since_push":5,"last_release_at":"2026-07-06T03:43:40Z"},"security_summary":{"status":"no_lockfile","scanner":null,"low_count":0,"high_count":0,"last_scan_at":"2026-07-11T23:10:31.035Z","medium_count":0,"scan_profile":"none","critical_count":0}},"capability_facts":{"scan":{"source":"repo_scan","observed_at":"2026-07-11T23:10:30.178Z"},"has_cli":{"value":true,"source":"pyproject.toml:[project.scripts]","observed_at":"2026-07-11T23:10:30.178Z"},"languages":{"value":["python"],"source":"github.language+pyproject.toml","observed_at":"2026-07-11T23:10:30.178Z"},"license_spdx":{"value":"MIT","source":"github.license","observed_at":"2026-07-11T23:10:30.178Z"}}}}