Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Augment benchmarks/vectorization_strategy_benchmark.py to include XLA compilation #165

Closed
LukeWood opened this issue Mar 7, 2022 · 7 comments

Comments

@LukeWood
Copy link
Contributor

LukeWood commented Mar 7, 2022

No description provided.

@bhack
Copy link
Contributor

bhack commented Mar 7, 2022

@bhack
Copy link
Contributor

bhack commented Mar 7, 2022

It seems that in the faster jit_compiled version all the tf.cast we have are still quite relevant

immagine

immagine

@bhack
Copy link
Contributor

bhack commented Mar 30, 2022

@qlzh727 What do you think about adding an extra parameter to the base class for jit_compile?
https://github.com/keras-team/keras/blob/master/keras/layers/preprocessing/image_preprocessing.py#L413-L414

So that we could optionally use

f = def_function.function(self._augment, jit_compile=True)
self._map_fn(f, inputs)

@LukeWood
Copy link
Contributor Author

@qlzh727 What do you think about adding an extra parameter to the base class for jit_compile? https://github.com/keras-team/keras/blob/master/keras/layers/preprocessing/image_preprocessing.py#L413-L414

So that we could optionally use

f = def_function.function(self._augment, jit_compile=True)
self._map_fn(f, inputs)

I personally would support a jit_compile attribute on the BaseImageAugmentationLayer.

so in a constructor you'd do:

jit_compile = True

and it would work pass it to the tf.function wrapping call.

@bhack
Copy link
Contributor

bhack commented Apr 11, 2022

We need to care about massively closing bugs a we lose interesting threads. This is now at keras-team/keras-io#1541

@LukeWood
Copy link
Contributor Author

We need to care about massively closing bugs a we lose interesting threads. This is now at keras-team/keras-io#1541

This is a distinct issue. I do not think benchmarks do not need this as the benchmarks existed to guide our direction.

you are right, BaseImageAugmentationLayer should support jit_compile, but the benchmarks do not need this so I closed this issue.

Closing bug is part of maintaining a clean project state.

@bhack
Copy link
Contributor

bhack commented Apr 11, 2022

Closing bug is part of maintaining a clean project state.

Yes but if there are still interesting parts emerged in the thread you need to spinoff that part on a new ticket or it will be lost forever.

freedomtan pushed a commit to freedomtan/keras-cv that referenced this issue Jul 20, 2023
* Add `steps_per_execution` to jax backend

* update code

* special case funcs

* add docstring

* simplify code

---------

Co-authored-by: Haifeng Jin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants