Skip to content

[Bug] [TIR] float infinity not supported in TIR with CUDA target #12566

@shingjan

Description

@shingjan

isinf is an operator in relay/topi/te. But when we lower relay functions containing isinf to cuda, the generated float infinity is not defined and supported, therefore an compilation error on nvcc is thrown.

Expected behavior

Infinity should be supported on TIR level as there is a function isinf in relay/topi/te.

Actual behavior

Compilation error:
/tmp/tmpr1n6rqid/my_kernel.cu(331): error: identifier "inff" is undefined

/tmp/tmpr1n6rqid/my_kernel.cu(276): warning #177-D: function "__pack_half2" was declared but never referenced

/tmp/tmpr1n6rqid/my_kernel.cu(301): warning #177-D: function "hpow" was declared but never referenced

/tmp/tmpr1n6rqid/my_kernel.cu(302): warning #177-D: function "htanh" was declared but never referenced

/tmp/tmpr1n6rqid/my_kernel.cu(303): warning #177-D: function "htan" was declared but never referenced

/tmp/tmpr1n6rqid/my_kernel.cu(304): warning #177-D: function "hatan" was declared but never referenced

/tmp/tmpr1n6rqid/my_kernel.cu(305): warning #177-D: function "herf" was declared but never referenced

1 error detected in the compilation of "/tmp/tmpr1n6rqid/my_kernel.cu".

Environment

Latest TVM main on Nvidia RTX3070

Steps to reproduce

Minimal repro script can be found here.

cc @Hzfengsy @junrushao @junrushao1994 @zxybazh

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions