Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Two small JAX-related cleanups

Abierto
#1,011 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
1-2 días
Aptitud para principiantes
52/100
Tipo de issue
Refactorización
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python
Área
backend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Python
Estrellas
33
Forks
33
Merge medio
1 h 2 min
PR fusionados (30 d)
36

Preparar el entorno

  • Sin Dockerfile ni archivo de Docker Compose
  • Tiene una plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de data-apis/array-api-extra

Todos los issues de data-apis/array-api-extra

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.