[BUG][intel:xe2] Dynamic shared memory (external_memory[.SHARED] + shared_mem_bytes) is Unimplemented

Đang mở
#7,600 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Lĩnh vực
compilers

Hướng nghiên cứu

Start with the stock test max/kernels/test/gpu/device_context/test_external_shared_mem.mojo, which reproduces the failure with shared_mem_bytes=16*1024 on intel:xe2. Trace how enqueue_function passes dynamic shared_mem_bytes down to the Intel launch path, where HALError code -20 (Unimplemented) is raised. Done means the test passes on xe2 and dynamic shared memory returns the same values as on other targets.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug_feature_triaged

Summary

Dynamic shared memory (the "size-at-launch" path) is Unimplemented on the Intel Arc Pro B60 (Xe2) target. external_memory[.SHARED] + enqueue_function[..., shared_mem_bytes=N] fails at runtime with HALError(code=-20): failed to execute function: Unimplemented. This reproduces with the stock, verbatim test_external_shared_mem test, so it is not specific to user code. Static shared memory (unsafe_stack_allocation[.SHARED]) works.

Environment

  • Target: intel:xe2 (Arc Pro B60, 16-lane warp)
  • IGC 2.41.15, compute-runtime 1.17.39758
  • Built via Bazel with --target-accelerator=intel:xe2
  • Single device pinned via ZE_AFFINITY_MASK=1

Minimal repro

This is the verbatim stock test max/kernels/test/gpu/device_context/test_external_shared_mem.mojo:

from max.gpu import thread_idx
from max.gpu.memory import external_memory
from max.gpu.sync import barrier

def dynamic_smem_kernel(data: MutPointer[Float32, MutAnyOrigin]):
    var dynamic_sram = external_memory[
        Float32, address_space=.SHARED, alignment=4
    ]()
    dynamic_sram[thread_idx.x] = Float32(thread_idx.x)
    barrier()
    data[thread_idx.x] = dynamic_sram[thread_idx.x]

# host side:
ctx.enqueue_function[kernel](res_device, grid_dim=1, block_dim=16,
                             shared_mem_bytes=16 * 1024)   # <- fails here

Observed (deterministic)

HALError(code=-20): failed to execute function: Unimplemented

The failure occurs at launch/execute of any kernel that uses external_memory[.SHARED] with a non-zero shared_mem_bytes.

Workaround

Fixed-size static shared memory works:

var smem = unsafe_stack_allocation[16, Float32, address_space=.SHARED]()  # OK

(the size must be a comptime constant, so the staging buffer size cannot be chosen at launch.)

Expected

external_memory[.SHARED] + shared_mem_bytes should allocate dynamic shared memory and run, matching the behavior on other targets and the stock test's intent.

Ngôn ngữ chính
Mojo
Star
30.2k
Fork
3.2k
Merge trung bình
6 ngày 20 giờ
Pull request đã merge (30 ngày)
25

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của modular/modular

Tất cả issue của modular/modular

Issue tương tự

Thêm issue về Compilers

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.