Skip to content

Use gesvd solver for SVDQuant #964

Description

@DefTruth
# CUDA:只能用gesvd,保证不报错、精度不丢
if original_device.type == "cuda":
    u, s, vt = torch.linalg.svd(weight_f64, driver="gesvd", full_matrices=False)
# CPU:用默认gesvd,速度最快
else:
    u, s, vt = torch.linalg.svd(weight_f64, full_matrices=False)

Activity

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions