-
Notifications
You must be signed in to change notification settings - Fork 7
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
Restructure public/private headers #324
Comments
@afuller-TT I would say though that we have a single "module" which is currently called "device", but we can view it as "umd" module.
|
@broskoTT I like your distinction between blackbox tests and whitebox tests. The blackbox tests in particular are useful for consumers to see how to interact with the module. Bikeshedding a bit here, how do you like this flattening of the
Essentially every 'module' (here we're only discussing the top-level UMD, currently named 'device', but the pattern should apply to anything at any scope), would consist of:
|
…sing them (#322) ### Issue Solving part of #324 ### Description It's currently unclear which files consist of UMD's public API and which are private headers. Additionally, consumers like tt-metal are reaching around with arbitrary paths to fetch headers. They shouldn't. There should be one place for the public API and one way for consumers to access it, and private stuff should remain private. ### List of the changes * Place all UMD Device's public API under `api/umd/device/` * Expose `api/` as the include dir, so all consumers must use `umd/device/foo.h` to include API headers * Even internal to UMD::Device, though this is subjective. * Do not expose any other directory publicly * Inside Device we may include other headers, but external consumers cannot. ### Testing Corresponding PR in tt-metal to consume with the new paths: ### API Changes (When making API changes, don't merge this PR until tt_metal and tt_debuda PRs are approved.) (Then merge this PR, change the client PRs to point to UMD main, and then merge them.) (Remove following lines if untrue) This PR has API changes: - [x] (If breaking change) tt_metal approved PR pointing to this branch: tenstorrent/tt-metal#15322 - [x] (If breaking change) tt_debuda approved PR pointing to this branch: tenstorrent/tt-lens#193
### Ticket Part of tenstorrent/tt-umd#324 ### Problem description UMD Device's public API has been reorganized into a clear separation with a canonical way of referencing it. Update consuming code accordingly. ### What's changed Update #include directives to use the canonical way of referencing UMD Device's public API. ### Checklist - [x] Post commit CI passes https://github.com/tenstorrent/tt-metal/actions/runs/12055033039 - [ ] Blackhole Post commit (if applicable) - [ ] Model regression CI testing passes (if applicable) - [ ] Device performance regression CI testing passes (if applicable) - [ ] New/Existing tests provide coverage for changes
@afuller-TT I did read your points, but I still can't wrap my head around for root/src/src/ to be okay (the double src is the problem). "files share the same level of abstraction in the directory tree" For example, in your suggestion, files would be: I'm sure I'm wrong, not sure why or where though. |
Motivation
There was an issue with tt_metal consuming umd, which was surfaced after #277.
The problem is that both tt-metal and umd have common dir, and that metal added umd's root dir to their include path. So in tt_metal, includes were ambiguous. This was solved by tenstorrent/tt-metal#15271
A follow up from that effort was that it wasn't clear what headers in umd are supposed to be publicly exposed. This issue is to track that work.
Initial change on clearing this up is being done in #322 .
Follow up changes might include renaming directories, to follow clearer structure of API headers and private implementation.
Details to be added in comment thread.
Suggested organization
@afuller-TT 's opinionated suggestion:
The root of the repo typically contains bookkeeping: Git files, lint configs, docs, etc. The code of a project should be immediately discoverable and clearly organized, but not tangled in with the peripheral files.
Something like this:
The premise being that any node in the tree has a CMakeLists.txt in its root and can be relocated anywhere else and it remain consistent. It clearly defines its public API, contains its implementation, and holds the tests for that level of abstraction. This continues like turtles all the way down. moduleA in this example is also a self contained entity with unit tests that validate moduleA, and a defined external interface. It's clearly an implementation detail of the upper scope, and if one day it's deemed useful at a larger scope it could be relocated with a simple
mv
command and oneadd_subdirectory
removed/added to relink it in its new home.The text was updated successfully, but these errors were encountered: