Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] hidet.ops.tan cannot work #450

Open
CBalaa opened this issue Apr 10, 2024 · 1 comment
Open

[Bug] hidet.ops.tan cannot work #450

CBalaa opened this issue Apr 10, 2024 · 1 comment
Labels
bug Something isn't working Task Or "Story" in JIRA's term.
Milestone

Comments

@CBalaa
Copy link

CBalaa commented Apr 10, 2024

Describe the bug
I found that hidet.ops.tan cannot work, the following is a part of traceback info:

Traceback (most recent call last):
  File "/root/test/test/test.py", line 6, in <module>
    y = ops.tan(hidet.from_torch(x))
  File "/root/miniconda3/envs/smore/lib/python3.10/site-packages/hidet/graph/ops/arithmetic.py", line 893, in tan
    return TanOp(x).outputs[0]
  File "/root/miniconda3/envs/smore/lib/python3.10/site-packages/hidet/graph/ops/arithmetic.py", line 452, in __init__
    super().__init__(x, op=lambda a: primitives.tan(a), name='tan')
  File "/root/miniconda3/envs/smore/lib/python3.10/site-packages/hidet/graph/ops/arithmetic.py", line 268, in __init__
    self.op = UnaryElementwiseOperation.from_callable(op, name, attributes, task_attributes)
  File "/root/miniconda3/envs/smore/lib/python3.10/site-packages/hidet/graph/ops/arithmetic.py", line 46, in from_callable
    y = op(x)
  File "/root/miniconda3/envs/smore/lib/python3.10/site-packages/hidet/graph/ops/arithmetic.py", line 452, in <lambda>
    super().__init__(x, op=lambda a: primitives.tan(a), name='tan')
  File "/root/miniconda3/envs/smore/lib/python3.10/site-packages/hidet/ir/primitives/math.py", line 372, in tan
    return generic_math_function_set.tan(a)
  File "/root/miniconda3/envs/smore/lib/python3.10/site-packages/hidet/ir/primitives/math.py", line 253, in tan
    return self.call('tan', a)
  File "/root/miniconda3/envs/smore/lib/python3.10/site-packages/hidet/ir/primitives/math.py", line 241, in call
    entry = lookup_primitive_function(f'generic_{name}')
  File "/root/miniconda3/envs/smore/lib/python3.10/site-packages/hidet/ir/primitives/func.py", line 105, in lookup_primitive_function
    return primitive_func_pool.lookup_by_name(name)
  File "/root/miniconda3/envs/smore/lib/python3.10/site-packages/hidet/ir/primitives/func.py", line 77, in lookup_by_name
    raise ValueError(
ValueError: Can not find primitive function with key: generic_tan, candidates:
generic_sin
generic_cos
generic_tanh
generic_exp
generic_round
generic_abs
generic_floor
generic_ceil
generic_sqrt
generic_rsqrt
generic_erf
...

To Reproduce

The following is my code for test:

import hidet
import torch
from hidet import ops

x = torch.randn([2, 2])
y = ops.tan(hidet.from_torch(x))
print(y)

Expected behavior
I hope it work normally.

Enviroment

  • OS: Ubuntu 22.04

  • Others: hidet version: 0.3.0

@CBalaa CBalaa added the bug Something isn't working label Apr 10, 2024
@wangshangsam wangshangsam added the Task Or "Story" in JIRA's term. label May 14, 2024
@wangshangsam wangshangsam added this to the 0.4.0 milestone May 14, 2024
@wangshangsam
Copy link
Collaborator

Hi @CBalaa ,

Thanks so much for trying out Hidet and reporting this bug! This bug has already been fixed in our internal branch, which will be released as part of our 0.4.0 release milestone (i.e., end of June). As a reference to other people who might've encountered the same bug, I'll keep this issue open until 0.4.0 is actually released. Stay tuned!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Task Or "Story" in JIRA's term.
Projects
None yet
Development

No branches or pull requests

2 participants