Skip to content

Support xla_hlo.convert operation on Structured Ops Path to SPIR-V #1687

Closed

Description

@MaheshRavishankar

Lowering xla_hlo.convert operations to SPIR-V on Structured Ops path requires use of std.trunci, std.sitofp, std.truncf, etc. The lowering from XLA-HLO to Linalg is fairly easy to add (the existing XLA-LHLO to Linalg lowering can be reused), but legalizing the std instructions to SPIR-V requires effective handling of integer widths.

Activity

  1. added this to the milestone on Apr 27, 2020
  2. changed the title [-]Support Convert operation on Structured Ops Path to SPIR-V[/-] [+]Support `xla_hlo.convert` operation on Structured Ops Path to SPIR-V[/+] on Apr 27, 2020
  3. changed the title [-]Support `xla_hlo.convert` operation on Structured Ops Path to SPIR-V[/-] [+]Support xla_hlo.convert operation on Structured Ops Path to SPIR-V[/+] on Apr 27, 2020
  4. hanhanW commented on Apr 28, 2020

    @hanhanW
    Contributor

    I studied a bit on this issue since I'm working on integer width adjustment. I have a CL chain to pass the test except the last test case -- float_to_int. I haven't figured out the reason, will take a look later.

  5. hanhanW commented on Apr 28, 2020

    @hanhanW
    Contributor

    Just found that the reason is quite simple.

    We don't have a pattern to convert floating point to integer in map_xla_to_scalar_op.h
    I don't know why, it seems that there is only SIToFPOp in Standard Dialect, but no FPToSIOp. It would be super easy to support once there is something like FPToSIOp in Standard Dialect.

  6. added
    codegen
    on Apr 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

codegen

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions