feat: prefer recipe ported einops - #1092
Conversation
Signed-off-by: David Holtz <david.richard.holtz@gmail.com>
|
for completeness, we can bump the commit hash from and trying to rerun the command shows at this point I simply asked and llm to fix the recipe so the port works correctly and copy pasted the command and error output above. the exact output of this process can be seen in #1093 |
|
I think we should have a single standard to start this. I would prefer if we required users to specify the source and the commit in the recipe itself instead of having them locally clone and checkout to a particular branch first. Or, that should be a better default behaviour, IMO.
We should port tests, too. Then it will be down on us to make modifications there e.g., for running specific tests on our CI, etc. Cc: @danieldk here as well. |
|
Going to run the commands from the PR description and share my findings here as well. |
| @@ -0,0 +1,12 @@ | |||
| { | |||
There was a problem hiding this comment.
Is this automatically generated by huggingface/kernels#776?
| find="from .packing import pack, unpack\n" \ | ||
| with="from .packing import pack, unpack\nfrom . import array_api\n" | ||
|
|
||
| // The rewritten tests and the flake. |
There was a problem hiding this comment.
We should not have to rewrite the tests much though. I think in the tests we would like to ensure that they use get_kernel() which already seems to be the case. So, I think we should rather provide similar instructions in the recipe to account for this.
pytest.mark.kernels_ci should probably be left to us because it's better if we decided which tests are lightweight and important enough to run on our CI.
| @@ -0,0 +1,60 @@ | |||
| recipe version=1 | |||
There was a problem hiding this comment.
I think we also decided to not maintain any top-level .ports?
| *collect_test_backends(symbolic=True, layers=True), | ||
| ] | ||
|
|
||
| # tensorflow.keras needs special way to compile, |
There was a problem hiding this comment.
Didn't expect this term to appear in 2026.
| @@ -0,0 +1,60 @@ | |||
| recipe version=1 | |||
|
|
|||
| // einops | |||
There was a problem hiding this comment.
Could we see an example where replace op is being used for torch op registration?
this pr is an example of using the kernel porting tool to port the upstream einops into the kernel builder format
first we clone the upstream source*
next we
running the command will show how each line of the recipe impacted the transformation and outputs all of the files added and deleted in the process.
*the pinning step is optional and is just to make sure that the source matches the specific checkout that is at the top of the
port.kdlfileimportant things
einopsdir