Skip to content

[Bug] subgroup.py __all__ missing broadcast, group_size, invocation_id #647

@alanray-tech

Description

@alanray-tech

Summary

broadcast, group_size, and invocation_id are defined as public functions in python/quadrants/lang/simt/subgroup.py but are missing from the module's __all__ list.

Details

The __all__ list at the bottom of subgroup.py (line 172-200) includes all other public functions -- including TODO stubs like broadcast_first, all_true, any_true, all_equal, and shuffle_xor -- but omits these three working implementations:

  • broadcast(value, index) (line 41) -- implemented, verified on CUDA/AMDGPU/SPIR-V
  • group_size() (line 45) -- implemented, SPIR-V only
  • invocation_id() (line 49) -- implemented, verified on CUDA/AMDGPU/SPIR-V

Impact

from quadrants.lang.simt.subgroup import * will not import these three functions. They remain accessible via explicit import or via qd.simt.subgroup.broadcast(), so impact is low, but it is inconsistent.

Suggested fix

Add the three missing names to __all__:

__all__ = [
    "barrier",
    "memory_barrier",
    "elect",
    "all_true",
    "any_true",
    "all_equal",
    "broadcast",        # <-- add
    "broadcast_first",
    "group_size",       # <-- add
    "invocation_id",    # <-- add
    "reduce_add",
    ...
]

Found during

Review of #639 (docs for qd.simt.subgroup).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions