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

Pulsar2 SIN operator failed to convert. #9

Open
nnn112358 opened this issue Feb 3, 2025 · 0 comments
Open

Pulsar2 SIN operator failed to convert. #9

nnn112358 opened this issue Feb 3, 2025 · 0 comments

Comments

@nnn112358
Copy link

nnn112358 commented Feb 3, 2025

Issue Overview :

In pulsar2 version 3.3, when target_hardware is AX620E, SIN operator could not be converted.
It proceeds to generate quant_axmodel.onnx, but fails to generate axmodel.

According to “2. NPU Operators support list(AX620E)”, Sin is Supported to Unlimited.
https://pulsar2-docs.readthedocs.io/en/latest/appendix/op_support_list_ax620e.html

When target_hardware was AX650,converting the SIN operator passed.
I hope that target_hardware is AX620E can also convert SIN operators.

Enviroment

  • pulsar2 version 3.3
  • target_hardware AX620E

reproduction procedure:

I have placed the file to be reproduced here.
https://github.com/nnn112358/pulsar2_onnxcheck_sin/tree/main

Image

# pulsar2 version
version: 3.3
commit: 3cdead5e

# python sin_export_model.py
Sin Operation:
Input shape: (1, 255)
Output shape: (1, 255)
Output range: [-1.0000, 0.9999]
Match: True

Tar file creation complete: input_data.tar
Temporary files deleted


root#  pulsar2 build --config sin_model_AX620E.json
~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~
===>export io data to folder: sin_model_AX620E/quant/debug/io
Building native ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
2025-02-04 00:59:31.819 | INFO     | yamain.command.build:compile_ptq_model:980 - group 0 compiler transformation
2025-02-04 00:59:31.862 | WARNING  | yamain.command.load_model:pre_process:616 - preprocess tensor [x]
2025-02-04 00:59:31.862 | WARNING  | yamain.command.load_model:post_process:638 - postprocess tensor [z]
2025-02-04 00:59:31.863 | INFO     | yamain.command.load_model:ir_compiler_transformation:824 - use quant data as gt input: x, float32, (1, 255)
2025-02-04 00:59:31.891 | INFO     | yamain.command.build:compile_ptq_model:999 - group 0 QuantAxModel macs: 0
2025-02-04 00:59:31.892 | INFO     | yamain.command.build:compile_ptq_model:1139 - subgraph [0], group: 0, type: GraphType.NPU
2025-02-04 00:59:31.892 | INFO     | yamain.command.npu_backend_compiler:compile:157 - compile npu subgraph [0]
tiling op... ⠋ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╺━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1/3 0:00:00
Traceback (most recent call last):
  File "<frozen yasched.graph_proc.graph_tiling>", line 109, in run
  File "<frozen backend>", line 158, in f
  File "<frozen backend.ax620e.backend_impl>", line 121, in build
AssertionError: AxQuantizedSin dont support

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<frozen yamain.common.error>", line 59, in guard_context
  File "<frozen yamain.command.build>", line 1169, in compile_ptq_model
  File "<frozen yamain.command.npu_backend_compiler>", line 199, in compile
  File "<frozen yasched.test_onepass>", line 3259, in test_onepass_ir
  File "<frozen yasched.test_onepass>", line 3243, in build
  File "<frozen yasched.test_onepass>", line 3383, in graph2models
  File "<frozen yasched.test_onepass>", line 670, in graph_sched
  File "<frozen yasched.graph_proc.graph_tiling>", line 134, in run
yasched.exceptions.TileFailException: AxQuantizedSin, AxQuantizedSin dont support
    op: /Sin
    attrs: {'const_inputs': {'x_scale': array(0.99607843, dtype=float32), 'r_scale': array(0.00784275, dtype=float32), 'x_zeropoint': array(0, dtype=int32), 'r_zeropoint': array(128, dtype=int32)}, 'output_dtype': 'U8', 'quant_method': 0}
    inputs: {'x': Tensor(U8, name=x_QuantizeLinear_out_link_var, shape=(1, 255), offset=0, bit_strides=(2048, 8))}
    mem_limit: MemLimit(workspace=524288, max_mem_size=720640)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "</opt/pulsar2/yamain/main.py>", line 4, in <module>
  File "<frozen yamain.main>", line 329, in <module>
  File "<frozen yamain.main>", line 257, in pulsar2
  File "<frozen yamain.main>", line 152, in wrapper
  File "<frozen yamain.common.error>", line 23, in wrapper
  File "<frozen yamain.command.build>", line 105, in build_error
  File "<frozen yamain.common.error>", line 14, in wrapper
  File "<frozen yamain.command.build>", line 507, in build
  File "<frozen yamain.command.build>", line 1172, in compile_ptq_model
  File "/usr/local/lib/python3.9/contextlib.py", line 137, in __exit__
    self.gen.throw(typ, value, traceback)
  File "<frozen yamain.common.error>", line 61, in guard_context
  File "<frozen yamain.common.error>", line 73, in error_func
yamain.common.error.CodeException: (<ErrorCode.NPUBackendError: 8>, TileFailException("AxQuantizedSin, AxQuantizedSin dont support\n    op: /Sin\n    attrs: {'const_inputs': {'x_scale': array(0.99607843, dtype=float32), 'r_scale': array(0.00784275, dtype=float32), 'x_zeropoint': array(0, dtype=int32), 'r_zeropoint': array(128, dtype=int32)}, 'output_dtype': 'U8', 'quant_method': 0}\n    inputs: {'x': Tensor(U8, name=x_QuantizeLinear_out_link_var, shape=(1, 255), offset=0, bit_strides=(2048, 8))}\n    mem_limit: MemLimit(workspace=524288, max_mem_size=720640)"))
@nnn112358 nnn112358 changed the title SIN operator failed to convert. Pulsar2 SIN operator failed to convert. Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant