Skip to content

[Feature Request] Running XLA functions on TPU #172

Description

@frasermince

Describe the bug

Upon running recv from the xla functions with jax tpus enabled I get the error: "NotImplementedError: MLIR translation rule for primitive 'AtariGymEnvPool_140079244014352_recv' not found for platform tpu". This is happening in a google tpu vm with python version 3.9.13, jax version 0.3.13, and envpool version 0.6.2.

To Reproduce

import jax
import envpool

env = envpool.make("Pong-v5", env_type="gym", num_envs=64, batch_size=16)
handle, recv, send, _ = env.xla()

handle2, data = recv(handle)

Expected behavior

I expect recv to work correctly on a tpu in a jitted jax program

Screenshots

image

System info

Describe the characteristic of your environment:

  • Python 3.9.13
  • Jax 0.3.13
  • Envpool 0.6.2
  • On a google TPU VM v3-8

Checklist

  • I have checked that there is no similar issue in the repo (required)
  • I have read the documentation (required)
  • I have provided a minimal working example to reproduce the bug (required)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions