I encountered something wrong with the relay pass `FastMath()` and 
`topi.fast_exp`.

I made a testing relay program with `exp` and build it with

```python
with relay.build_config(opt_level=4):
    graph, lib, params = relay.build(mod, target, params=params)
```

to enable and build `Op(fast_exp)`, but I got an error: 

```
all_impls = get_valid_implementations(op, attrs, inputs, out_type, target)
  File "/home/selo/tvm/python/tvm/relay/backend/compile_engine.py", line 122, 
in get_valid_implementations
    assert fstrategy is not None, "%s doesn't have FTVMStrategy registered" % 
op.name
AssertionError: fast_exp doesn't have FTVMStrategy registered
```

It seems that there's a gap between the relay Op and topi implementation, so I 
inserted two lines: 

```python 
register_broadcast_schedule("fast_exp")
register_shape_func("fast_exp", False, elemwise_shape_func)
```

in `python/tvm/relay/op/_tensor.py`

![image|690x167](upload://kX0mHTyobZUTi0e1Kn1Ua1kdego.png) 

and turns out it worked. 

Is this the intended way to use `Op(fast_exp)`?

Thanks.





---
[Visit Topic](https://discuss.tvm.ai/t/relay-op-fast-exp-cant-be-built/6046/1) 
to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click 
here](https://discuss.tvm.ai/email/unsubscribe/a0059fc664bdde209300f549aff95e9f76ed6b91ef2c65ba039e554a96819226).

Reply via email to