{"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":426,"forks":20,"topics":["llm","qep","quantization","vllm"],"archived":false,"github_pushed_at":"2026-09-14T12:48:55+00:00","maintenance_label":"Very active","stars_delta_30d":28,"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":8,"watchers":4,"ai_summary":"OneCompression is a Python package designed for compressing large language models using techniques such as quantization.","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-09-20T04:29:32.70787+00:00","categories":[{"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"},{"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"}],"tags":[{"slug":"compression","name":"compression"},{"slug":"cuda","name":"cuda"},{"slug":"llm","name":"llm"},{"slug":"mps","name":"mps"},{"slug":"pytorch","name":"pytorch"},{"slug":"qep","name":"qep"},{"slug":"quantization","name":"quantization"},{"slug":"vllm","name":"vllm"}],"trust":{"provenance":{"is_fork":false,"github_id":1196059417,"owner_type":"Organization","methodology":"github_public_v1","parent_repo":null,"near_duplicate_slugs":[]},"computed_at":"2026-09-18T08:16:37.136Z","maintenance":{"label":"Very active","score":96,"methodology":"github_public_v1","releases_90d":6,"days_since_push":3,"last_release_at":"2026-09-03T02:06:02Z","stars_delta_30d":28,"open_issues_delta_30d":1},"security_summary":{"status":"no_lockfile","scanner":null,"low_count":0,"high_count":0,"last_scan_at":"2026-09-18T08:16:39.362Z","medium_count":0,"scan_profile":"none","critical_count":0}},"capability_facts":{"scan":{"source":"repo_scan","observed_at":"2026-09-18T08:16:36.032Z"},"has_cli":{"value":true,"source":"pyproject.toml:[project.scripts]","observed_at":"2026-09-18T08:16:36.032Z"},"languages":{"value":["python"],"source":"github.language+pyproject.toml","observed_at":"2026-09-18T08:16:36.032Z"},"license_spdx":{"value":"MIT","source":"github.license","observed_at":"2026-09-18T08:16:36.032Z"}},"decision_facts":{"hosting":null,"pricing":null,"requirements":null,"constraints":null,"when_to_use":["Use OneCompression when you need to compress large language models and have access to a Linux system with an NVIDIA GPU, as it supports CUDA for quantization and vLLM serving.","Consider OneCompression for macOS users who require MPS for inference, as it supports GPTQ quantization and Hugging Face `generate()` inference on MPS.","Use OneCompression if you are working in a development environment and need tools like black, pre-commit, pytest, and pylint, as these can be installed with the `--extra dev` option."],"when_not_to_use":["Avoid OneCompression if you are working on a macOS system and require vLLM serving, as it is only supported on Linux with an NVIDIA GPU.","Do not use OneCompression if you are working with Python 3.13 and CUDA, as the first run with `--extra vllm` may take a long time due to the lack of pre-built `xformers` wheels for this combination.","Do not use OneCompression if you need to work with older CUDA versions like `cu118` or `cu121` and require vLLM, as `--extra vllm` is only compatible with `cu130`."],"source":"enrich:decision_facts","observed_at":"2026-09-18T10:32:42.008Z"},"constraint_facets":null,"decision_summary":[{"label":"Adopt for","value":"OneCompression is a Python package for compressing large language models using techniques such as quantization, with support for CUDA and MPS for different environments."}]}}