apache / tvm

Open deep learning compiler stack for cpu, gpu and specialized accelerators
https://tvm.apache.org/
Apache License 2.0
11.42k stars 3.4k forks source link

[Relax] [PyTorch] Add support for torch.nn.Hardswish #17084

Closed mshr-h closed 4 weeks ago

mshr-h commented 4 weeks ago

17068

This is only for the fx frontend. But ONNX has the same HardSwish operator. I am thinking to add something like relax.nn.hardswish operator and call it from fx/onnx frontend after this PR is merged.

cc @yongwww @tqchen

yongwww commented 4 weeks ago

I am not sure if we need to introduce a new operator Hardswish to relax, looks we can compose it with several existing ops like add, and those ops are able to be fused by FuseOps pass, that means we won't lose perf even we compose it with several existing ops.

cc: @tqchen @vinx13 @MasterJH5574