Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_quantize_per_channel gets core dump #1428

Open
weishi-deng opened this issue Mar 4, 2025 · 0 comments
Open

test_quantize_per_channel gets core dump #1428

weishi-deng opened this issue Mar 4, 2025 · 0 comments
Assignees
Labels
bug Something isn't working module: quant
Milestone

Comments

@weishi-deng
Copy link
Contributor

weishi-deng commented Mar 4, 2025

🐛 Describe the bug

import torch

def test_quantize_per_channel(dtype=torch.float):
    src_cpu = torch.randn(1, 3, 2, 2)
    src_gpu = src_cpu.to("xpu")

    data_type = torch.qint8
    channel_scale_cpu = torch.Tensor([0.1, 0.3, 0.5])
    channel_zero_point_cpu = torch.tensor([0, 0, 0])
    channel_scale_xpu = torch.Tensor([0.1, 0.3, 0.5]).to("xpu")
    channel_zero_point_xpu = torch.tensor([0, 0, 0]).to("xpu")

    dst_gpu = torch.quantize_per_channel(
        src_gpu,
        scales=channel_scale_xpu,
        zero_points=channel_zero_point_xpu,
        dtype=data_type,
        axis=1,
    )
    print(dst_gpu)

test_quantize_per_channel()

Versions

pytorch 2.7

@Stonepia Stonepia added bug Something isn't working module: quant labels Mar 7, 2025
@chuanqi129 chuanqi129 added this to the PT2.7 milestone Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working module: quant
Projects
None yet
Development

No branches or pull requests

4 participants