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

Scan example doesn't work #1071

Closed
AlexanderKalistratov opened this issue Jun 14, 2023 · 1 comment · Fixed by #1400
Closed

Scan example doesn't work #1071

AlexanderKalistratov opened this issue Jun 14, 2023 · 1 comment · Fixed by #1400
Assignees
Labels
bug Something isn't working user User submitted issue
Milestone

Comments

@AlexanderKalistratov
Copy link
Contributor

python examples/kernel/scan.py

Output:

Original array: [ 0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63]
Using device ...
Device(level_zero:gpu:0)
Traceback (most recent call last):
  File "/home/akalistr/repo/numba-dpex/numba_dpex/examples/kernel/scan.py", line 69, in <module>
    main()
  File "/home/akalistr/repo/numba-dpex/numba_dpex/examples/kernel/scan.py", line 59, in main
    kernel_hillis_steele_scan[ndpx.Range(N)](arr)
  File "/home/akalistr/miniconda3/envs/dpbench-dev/lib/python3.10/site-packages/numba_dpex/core/kernel_interface/dispatcher.py", line 455, in __call__
    ) = self._compile_and_cache(
  File "/home/akalistr/miniconda3/envs/dpbench-dev/lib/python3.10/site-packages/numba_dpex/core/kernel_interface/dispatcher.py", line 141, in _compile_and_cache
    kernel.compile(
  File "/home/akalistr/miniconda3/envs/dpbench-dev/lib/python3.10/site-packages/numba_dpex/core/kernel_interface/spirv_kernel.py", line 123, in compile
    cres = compile_with_dpex(
  File "/home/akalistr/miniconda3/envs/dpbench-dev/lib/python3.10/site-packages/numba/core/compiler_lock.py", line 35, in _acquire_compile_lock
    return func(*args, **kwargs)
  File "/home/akalistr/miniconda3/envs/dpbench-dev/lib/python3.10/site-packages/numba_dpex/core/compiler.py", line 64, in compile_with_dpex
    cres = compiler.compile_extra(
  File "/home/akalistr/miniconda3/envs/dpbench-dev/lib/python3.10/site-packages/numba/core/compiler.py", line 742, in compile_extra
    return pipeline.compile_extra(func)
  File "/home/akalistr/miniconda3/envs/dpbench-dev/lib/python3.10/site-packages/numba/core/compiler.py", line 460, in compile_extra
    return self._compile_bytecode()
  File "/home/akalistr/miniconda3/envs/dpbench-dev/lib/python3.10/site-packages/numba/core/compiler.py", line 528, in _compile_bytecode
    return self._compile_core()
  File "/home/akalistr/miniconda3/envs/dpbench-dev/lib/python3.10/site-packages/numba/core/compiler.py", line 507, in _compile_core
    raise e
  File "/home/akalistr/miniconda3/envs/dpbench-dev/lib/python3.10/site-packages/numba/core/compiler.py", line 494, in _compile_core
    pm.run(self.state)
  File "/home/akalistr/miniconda3/envs/dpbench-dev/lib/python3.10/site-packages/numba/core/compiler_machinery.py", line 368, in run
    raise patched_exception
  File "/home/akalistr/miniconda3/envs/dpbench-dev/lib/python3.10/site-packages/numba/core/compiler_machinery.py", line 356, in run
    self._runPass(idx, pass_inst, state)
  File "/home/akalistr/miniconda3/envs/dpbench-dev/lib/python3.10/site-packages/numba/core/compiler_lock.py", line 35, in _acquire_compile_lock
    return func(*args, **kwargs)
  File "/home/akalistr/miniconda3/envs/dpbench-dev/lib/python3.10/site-packages/numba/core/compiler_machinery.py", line 311, in _runPass
    mutated |= check(pss.run_pass, internal_state)
  File "/home/akalistr/miniconda3/envs/dpbench-dev/lib/python3.10/site-packages/numba/core/compiler_machinery.py", line 273, in check
    mangled = func(compiler_state)
  File "/home/akalistr/miniconda3/envs/dpbench-dev/lib/python3.10/site-packages/numba/core/typed_passes.py", line 110, in run_pass
    typemap, return_type, calltypes, errs = type_inference_stage(
  File "/home/akalistr/miniconda3/envs/dpbench-dev/lib/python3.10/site-packages/numba/core/typed_passes.py", line 88, in type_inference_stage
    errs = infer.propagate(raise_errors=raise_errors)
  File "/home/akalistr/miniconda3/envs/dpbench-dev/lib/python3.10/site-packages/numba/core/typeinfer.py", line 1086, in propagate
    raise errors[0]
numba.core.errors.TypingError: Failed in dpex_kernel_nopython mode pipeline (step: nopython frontend)
No implementation of function Function(<function local.array at 0x7f9fc867dc60>) found for signature:
 
 >>> array(int64, dtype=dtype(int64))
 
There are 2 candidate implementations:
     - Of which 2 did not match due to:
     Overload of function 'array': File: numba_dpex/ocl/ocldecl.py: Line 141.
       With argument(s): '(int64, dtype=dtype(int64))':
      No match.

During: resolving callee type: Function(<function local.array at 0x7f9fc867dc60>)
During: typing of call at /home/akalistr/repo/numba-dpex/numba_dpex/examples/kernel/scan.py (24)


File "examples/kernel/scan.py", line 24:
def kernel_hillis_steele_scan(a):
    <source elided>
    # Create temporals in local memory
    b = ndpx.local.array(ls, dtype=a.dtype)
    ^
@diptorupd diptorupd added the user User submitted issue label Oct 3, 2023
@chudur-budur chudur-budur self-assigned this Nov 2, 2023
@diptorupd diptorupd assigned diptorupd and unassigned chudur-budur Dec 10, 2023
@diptorupd diptorupd added the bug Something isn't working label Dec 20, 2023
@diptorupd diptorupd added this to the 0.23 milestone Dec 20, 2023
@diptorupd
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working user User submitted issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants