Skip to content

Wrong results for arange on VSX #58551

@Flamefire

Description

@Flamefire

🐛 Bug

The arange function for integers returns wrong results when sub-steps are used, i..e the increase from value to value is not an integer.

To Reproduce

Steps to reproduce the behavior:

$ import torch
$ torch.linspace(-100, 100, 401, device='cpu', dtype=torch.int32)
tensor([-100, -100, -100, -100, -100, -100, -100, -100,  -96,  -96,  -96,  -96,
         -96,  -96,  -96,  -96,  -92,  -92,  -92,  -92,  -92,  -92,  -92,  -92,
         -88,  -88,  -88,  -88,  -88,  -88,  -88,  -88,  -84,  -84,  -84,  -84,
...

Expected behavior

tensor([-100,  -99,  -99,  -98,  -98,  -97,  -97,  -96,  -96,  -95,  -95,  -94,
         -94,  -93,  -93,  -92,  -92,  -91,  -91,  -90,  -90,  -89,  -89,  -88,
         -88,  -87,  -87,  -86,  -86,  -85,  -85,  -84,  -84,  -83,  -83,  -82,

Environment

 - PyTorch Version (e.g., 1.0): 1.8.1
 - OS (e.g., Linux): RHEL on PPC

This is a regression from 1.7 to 1.8 and should at least be fixed for 1.9

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: POWERIssues specific to the POWER/ppc architecturemodule: vectorizationRelated to SIMD vectorization, e.g., Vec256triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions