Skip to content

Conversation

@andompesta
Copy link

What does this PR do?

Type of change: ?

Bug fix: default svd solver does not work for ill-conditioned matrixes. Switch to gesvd solver as it is more accurate (as per documentation) as does not fails for ill-conditioned matrixes

Overview: ?

Usage

# Add a code snippet demonstrating how to use this

Testing

Before your PR is "Ready for review"

  • Make sure you read and follow Contributor guidelines and your commits are signed.
  • Is this change backward compatible?: Yes
  • Did you write any new necessary tests?: No. as we might not want to test all matrix shapes
  • Did you add or update any necessary documentation?: No need to change the documentation
  • Did you update Changelog?: No

Additional Information

@andompesta andompesta requested a review from a team as a code owner December 8, 2025 10:56
@andompesta andompesta requested a review from jingyu-ml December 8, 2025 10:56
@copy-pr-bot
Copy link

copy-pr-bot bot commented Dec 8, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Signed-off-by: scavallari <scavallari@nviia.com>
@andompesta andompesta force-pushed the scavallari_svd-quant_opt branch from 95f9b7e to c513c47 Compare December 8, 2025 10:58
@jingyu-ml
Copy link
Contributor

LGTM. As a reference, could you point me to the documentation?

@jingyu-ml jingyu-ml enabled auto-merge (squash) December 9, 2025 10:27
@kevalmorabia97 kevalmorabia97 changed the title us gesvd as solver Use gesvd as solver Dec 18, 2025
@kevalmorabia97
Copy link
Collaborator

/ok to test c513c47

@kevalmorabia97
Copy link
Collaborator

@andompesta seems like our SVD Quant tests fail on CPU: https://github.com/NVIDIA/Model-Optimizer/actions/runs/20025754823/job/58410748645?pr=661

FAILED tests/unit/torch/quantization/test_calib.py::test_svdquant_lora_weights
FAILED tests/unit/torch/quantization/test_quantize_cpu.py::test_quantize[config4-SimpleLinear]
FAILED tests/unit/torch/quantization/test_quantize_cpu.py::test_quantize[config4-SimpleConvLinear]
FAILED tests/unit/torch/quantization/test_quantize_cpu.py::test_save_restore[SimpleLinear-quant_config3]
RuntimeError: torch.linalg.svd: keyword argument `driver=` is only supported on CUDA inputs with cuSOLVER backend.

@andompesta
Copy link
Author

I see, I gived it for granted that svd runs on cuda devices

@kevalmorabia97
Copy link
Collaborator

Thanks. One more thing:

Commit sha: 84fc8fb, Author: scavallari, Committer: scavallari; The sign-off is missing.

Please use git commit -s -S for signing-off. More details in https://github.com/NVIDIA/TensorRT-Model-Optimizer/blob/main/CONTRIBUTING.md#%EF%B8%8F-signing-your-work

@andompesta andompesta force-pushed the scavallari_svd-quant_opt branch 5 times, most recently from 79b14a2 to 389728b Compare December 19, 2025 19:13
@andompesta andompesta force-pushed the scavallari_svd-quant_opt branch from 389728b to 9fbbbeb Compare December 19, 2025 19:15
@kevalmorabia97
Copy link
Collaborator

Still failing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants