Replies: 1 comment 4 replies
-
Any place that you use value-dependent control flow will cause this issue; I see several places in your snippet that would be problematic under JIT compilation. This doc page: https://jax.readthedocs.io/en/latest/notebooks/Common_Gotchas_in_JAX.html#%F0%9F%94%AA-Control-Flow has some discussion about why this is, and some ideas of what you can do to work around it. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I am fairly new to jax and I am encountering the following error:
ConcretizationTypeError: Abstract tracer value encountered where concrete value is expected (in
bool
).I have read https://jax.readthedocs.io/en/latest/faq.html#abstract-tracer-value-encountered-where-concrete-value-is-expected-error and I think I understand what causes the error but not how to remedy it.
I am basically just trying to use to jax to parallelize a very simple implementation of ray-tracing. I do not require automatic-differentiation (at least at the moment).
I understand that
if jnp.abs(a) < EPS
is causing the problem, becausea
is a function ofp2
andvmap
introduces abstract tracers for its arguments andp2
is the argument of thevmap
. However, I don't know how I would fix this issue.Any pointers greatly appreciated.
The issues I was having were caused by not using
jax.lax.cond
. Below you can find the fixed version.The code below works fine but seems to be mainly executed on the CPU.
Beta Was this translation helpful? Give feedback.
All reactions