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

Refine Python API #1806

Open
hunhoffe opened this issue Sep 30, 2024 · 3 comments
Open

Refine Python API #1806

hunhoffe opened this issue Sep 30, 2024 · 3 comments
Assignees

Comments

@hunhoffe
Copy link
Collaborator

hunhoffe commented Sep 30, 2024

This issue is a method of tracking/deconflicting efforts to change the Python API. If anyone has any PRs to change the Python API please let me know and we can record them here! We can also use this issue to record ideas/brainstorming before a PR is created.

Planned

  • Clean up user error messages

In-Progress

Completed

Notes

@hunhoffe hunhoffe self-assigned this Sep 30, 2024
@fifield
Copy link
Collaborator

fifield commented Sep 30, 2024

  • Clean up WriteRTP/Buffer APIs e.g., code like here:

It's not clear to me that we still need the RTP ops, given that npu.write32 and npu.blockwrite offer essentially the same functionality. What's the plan for RTP ops?

@hunhoffe
Copy link
Collaborator Author

hunhoffe commented Sep 30, 2024

@fifield I didn't have anything major planned, I'm just trying to get rid of all the Python operations that expect symbol names instead of python objects, so I was thinking about changing

NpuWriteRTPOp("rtpComputeTile2", index=0, value=50) 

To either

rtpComputeTile2.rtpWrite(index=0, value=50)

or (not sure if this is possible to infer the right type of write operation if these is more than one, so maybe not)

rtpComputeTile2[0] = 50

Currently, NpuWriteRTPOp is used in the following programming examples:

  • ml/resnet/layers_conv2_x
  • ml/conv2d_fused_relu
  • ml/bottleneck
  • ml/conv2d
  • vision/color_threshold/aie2_colorThreshold.py

I'm not sure what the differences between NpuWriteRTPOp and npu.write32/npu.blockwrite are, but alternatively I could try to port those examples to use npu.write32/npu.blockwrite instead?

@hunhoffe
Copy link
Collaborator Author

hunhoffe commented Oct 2, 2024

To record decisions make offline: RTP ops will probably be used with some additional synchronization method in the future, so it's worth it to clean up the Python interface

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