Lightning-AI / Lightning-AI/pytorch-lightning

how to implement a customer precision with torchao

Open
#21,425 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

3rd party bug ver: 2.5.x
Dominant language
Python
Stars
31.4k
Forks
3.8k
Avg merge
6d 7h
Merged PRs (30d)
6

Description

Bug description

hi, I implemented a customer precision with torchao.quantization.Int8WeightOnlyConfig, but unfortunately it looks like customer precision plugin integrated is not allowed in the lightning since the function _convert_precision_to_unified_args in lightning/fabric/connector.py check only the offical implement precision. Does anyone know, how can I implement it?

What version are you seeing the problem on?

v2.5

Reproduced in studio

No response

How to reproduce the bug

Error messages and logs
# Error messages and logs here please
Environment
Current environment
#- PyTorch Lightning Version (e.g., 2.5.0):
#- PyTorch Version (e.g., 2.5):
#- Python version (e.g., 3.12):
#- OS (e.g., Linux):
#- CUDA/cuDNN version:
#- GPU models and configuration:
#- How you installed Lightning(`conda`, `pip`, source):
More info

No response

cc @ethanwharris

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the precision handling in lightning/fabric/connector.py, especially _convert_precision_to_unified_args, and compare it with the reported torchao.quantization.Int8WeightOnlyConfig usage. The issue has no reproduction, error output, or environment details, so establish those first; done would require a confirmed way for the custom precision configuration to work or a clearly scoped supported-change proposal.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.