Skip to content

Specifying id_tap dependency without data copy #14775

Answered by sharadmv
jaywonchung asked this question in Q&A
Discussion options

You must be logged in to vote

Could you try using jax.debug.callback(..., ordered=True)? This is our newer API though and by saying ordered=True you are forcing callbacks to be run sequentially relative to each other. host_callback behaves like ordered debug callback.

In general, there is no way to enforce a callback runs after a certain computation without adding data dependency (and extra copying) as you've done. As a result, the callbacks aren't reliable for timing and measuring performance. I'd suggest using the profiler instead.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@jaywonchung
Comment options

@sharadmv
Comment options

@jaywonchung
Comment options

Answer selected by jaywonchung
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants