Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Two small JAX-related cleanups

Đang mở
#1,011 2 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 1 ngày

@nightcityblade đang làm issue này rồi.

Từ ngày 13/10/2026.

  • #1022 của @nightcityblade — đang mở

Đánh giá

Độ khó
4/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
52/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
backend

Hướng nghiên cứu

Read src/array_api_extra/_lib/_helpers.py around the JAX capabilities() workaround and src/array_api_extra/_agnostic/_set.py around nunique. The issue leaves removal of the workaround contingent on deciding whether to support JAX versions below 0.6.0, so first check project policy and tests. Done means the comments accurately describe JAX's unique_counts behavior, and any shim or minimum-version documentation reflects the project's support decision.

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

Mô tả

1. Drop the capabilities() shim for jax < 0.6.0?

https://github.com/data-apis/array-api-extra/blob/04407df9d1f8a06f72faf1d9951c82f81f237d06/src/array_api_extra/_lib/_helpers.py#L315-L320

_helpers.capabilities forces "boolean indexing" to False for JAX. This works around jax-ml/jax#27418, which was fixed in JAX 0.6.0 (March 2025). CI pins jax >= 0.10.2, so this branch never runs there (it is marked # pragma: no cover).

The package doesn't declare a minimum JAX version, so whether to remove it is a policy question: do we still want to support JAX < 0.6.0 at runtime? If not, the branch can be deleted:

out = xp.__array_namespace_info__().capabilities()
if _compat.is_torch_namespace(xp):
    ...

Removing it would also be a good moment to document a minimum supported JAX version.

2. Inaccurate comment in nunique

https://github.com/data-apis/array-api-extra/blob/04407df9d1f8a06f72faf1d9951c82f81f237d06/src/array_api_extra/_agnostic/_set.py#L31-L35

# 3. backend does not have unique_counts; e.g. wrapped JAX

JAX does have unique_counts. It takes the O(n log n) sort-based path because capabilities()["data-dependent shapes"] is False (the output shape of unique_counts can't be known under jax.jit). Also, JAX is no longer "wrapped": jax.numpy is used directly. Suggested wording:

# 3. backend lacks data-dependent shapes, so unique_counts is unusable
#    (e.g. JAX, whose output shape can't be known under jax.jit)

The comment just below it, # xp does not have unique_counts; O(n*logn) complexity, should be updated the same way.

Ngôn ngữ chính
Python
Star
33
Fork
33
Merge trung bình
1 giờ 16 phút
Pull request đã merge (30 ngày)
32

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

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

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 data-apis/array-api-extra

Tất cả issue của data-apis/array-api-extra

Issue tương tự

Thêm issue về Python

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.