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

Tracy with internalized Capstone 6 #16777

Closed
bjacob opened this issue Mar 14, 2024 · 2 comments
Closed

Tracy with internalized Capstone 6 #16777

bjacob opened this issue Mar 14, 2024 · 2 comments
Assignees

Comments

@bjacob
Copy link
Contributor

bjacob commented Mar 14, 2024

Context

Tracy has an external dependency on Capstone for disassembly.

Only the current development branch of capstone, named next, is recent enough for our purposes, ans we in IREE are living on the cutting edge of new SIMD ISA extensions. Its version number is 6, so we currently want Capstone 6, but by the time it becomes stable we'll probably want Capstone 7, etc. We want the cutting edge.

That has been a problem for IREE users with Tracy, requiring custom documentation. Compounding that, Capstone has recently done a breaking renaming, requiring patching Tracy: wolfpld/tracy#671 .

Now on the latter Tracy PR the discussion has mentioned that another Tracy PR wolfpld/tracy#707 is about to internalize Tracy as a CPM.cmake package. I don't know any specifics of CPM.cmake, but that shouldn't matter too much for us since we are carrying our own Tracy CMake setup anyway: https://github.com/openxla/iree/blob/main/build_tools/third_party/tracy/CMakeLists.txt

So once Tracy has internalized a version of Capstone (currently 5.0.1), we could do a Tracy bump on our side, also internalizing the same version of Capstone in whichever way works for us; and then as a second step from there, we could work with Tracy upstream on a Capstone 5->6 bump, the Tracy-side code changes being as in wolfpld/tracy#671 or the simpler macro-expansion of that since, being internalized, now we wouldn't have to worry about compatibility with other Capstone versions anymore.

Steps

### Tasks
- [ ] Wait for https://github.com/wolfpld/tracy/pull/707 to be merged.
- [ ] Bump Tracy, internalize the same Capstone 5 version in our own way.
- [ ] Work on a Tracy-side bump of its Capstone version from 5 to 6, as in https://github.com/wolfpld/tracy/pull/671.
- [ ] Bump Tracy again and simultaneously bump Capstone to 6.
@bjacob bjacob self-assigned this Mar 14, 2024
ScottTodd added a commit that referenced this issue Apr 9, 2024
Progress on #14470

|  |  |
| -- | -- |
| Current page |
https://iree.dev/developers/performance/profiling-with-tracy/ |
| This PR |
https://scotttodd.github.io/iree/developers/performance/profiling-with-tracy/
|

This restructures the "Profiling with Tracy" developer doc / website
page to focus less on the specifics of build and compile configurations
and more on what Tracy is and how to use it. Troubleshooting tips and
building from source instructions are still included but they are off to
the side. I also added new screenshots, diagrams, tips, and formatting.

Some of the "building from source" instructions can be further
simplified if we
* start using [Tracy's recently added upstream CMake
build](https://github.com/wolfpld/tracy/blob/master/CMakeLists.txt) (in
fact, the old Visual Studio solutions and Makefiles were removed in
wolfpld/tracy@7f8a2e2)
* address #16777
ScottTodd added a commit that referenced this issue May 23, 2024
Progress on #16777

The main change here is switching from maintaining our own
`build_tools/third_party/tracy_client/CMakeLists.txt` file for the Tracy
client library and `build_tools/third_party/tracy/CMakeLists.txt` file
for all of the Tracy server tools (capture, profiler, csv export) to
only supporting the 'capture' tool there. Developers should be using the
upstream CMake projects to build the profiler, csv export, and other
tools. I tried to use the upstream build for the 'capture' tool but the
upstream project pulls in extra deps and modifies several top level
CMake options.

* Before, `IREE_BUILD_TRACY` would build `iree-tracy-profiler`,
`iree-tracy-capture`, and `iree-tracy-csvexport` tools
* Now, `IREE_BUILD_TRACY` just builds `iree-tracy-capture`

Both before and after this change, a `iree-tracy-capture` tool is
bundled into the runtime Python bindings.

---------

Signed-off-by: Scott Todd <scott.todd0@gmail.com>
@ScottTodd
Copy link
Member

Tracy has been updated in IREE. Let's update the capstone version upstream and then update again?

gglangg pushed a commit to gglangg/iree that referenced this issue Jun 4, 2024
Progress on iree-org#16777

The main change here is switching from maintaining our own
`build_tools/third_party/tracy_client/CMakeLists.txt` file for the Tracy
client library and `build_tools/third_party/tracy/CMakeLists.txt` file
for all of the Tracy server tools (capture, profiler, csv export) to
only supporting the 'capture' tool there. Developers should be using the
upstream CMake projects to build the profiler, csv export, and other
tools. I tried to use the upstream build for the 'capture' tool but the
upstream project pulls in extra deps and modifies several top level
CMake options.

* Before, `IREE_BUILD_TRACY` would build `iree-tracy-profiler`,
`iree-tracy-capture`, and `iree-tracy-csvexport` tools
* Now, `IREE_BUILD_TRACY` just builds `iree-tracy-capture`

Both before and after this change, a `iree-tracy-capture` tool is
bundled into the runtime Python bindings.

---------

Signed-off-by: Scott Todd <scott.todd0@gmail.com>
gglangg pushed a commit to gglangg/iree that referenced this issue Jun 4, 2024
Progress on iree-org#16777

The main change here is switching from maintaining our own
`build_tools/third_party/tracy_client/CMakeLists.txt` file for the Tracy
client library and `build_tools/third_party/tracy/CMakeLists.txt` file
for all of the Tracy server tools (capture, profiler, csv export) to
only supporting the 'capture' tool there. Developers should be using the
upstream CMake projects to build the profiler, csv export, and other
tools. I tried to use the upstream build for the 'capture' tool but the
upstream project pulls in extra deps and modifies several top level
CMake options.

* Before, `IREE_BUILD_TRACY` would build `iree-tracy-profiler`,
`iree-tracy-capture`, and `iree-tracy-csvexport` tools
* Now, `IREE_BUILD_TRACY` just builds `iree-tracy-capture`

Both before and after this change, a `iree-tracy-capture` tool is
bundled into the runtime Python bindings.

---------

Signed-off-by: Scott Todd <scott.todd0@gmail.com>
bangtianliu pushed a commit to bangtianliu/iree that referenced this issue Jun 5, 2024
Progress on iree-org#16777

The main change here is switching from maintaining our own
`build_tools/third_party/tracy_client/CMakeLists.txt` file for the Tracy
client library and `build_tools/third_party/tracy/CMakeLists.txt` file
for all of the Tracy server tools (capture, profiler, csv export) to
only supporting the 'capture' tool there. Developers should be using the
upstream CMake projects to build the profiler, csv export, and other
tools. I tried to use the upstream build for the 'capture' tool but the
upstream project pulls in extra deps and modifies several top level
CMake options.

* Before, `IREE_BUILD_TRACY` would build `iree-tracy-profiler`,
`iree-tracy-capture`, and `iree-tracy-csvexport` tools
* Now, `IREE_BUILD_TRACY` just builds `iree-tracy-capture`

Both before and after this change, a `iree-tracy-capture` tool is
bundled into the runtime Python bindings.

---------

Signed-off-by: Scott Todd <scott.todd0@gmail.com>
LLITCHEV pushed a commit to LLITCHEV/iree that referenced this issue Jul 30, 2024
Progress on iree-org#16777

The main change here is switching from maintaining our own
`build_tools/third_party/tracy_client/CMakeLists.txt` file for the Tracy
client library and `build_tools/third_party/tracy/CMakeLists.txt` file
for all of the Tracy server tools (capture, profiler, csv export) to
only supporting the 'capture' tool there. Developers should be using the
upstream CMake projects to build the profiler, csv export, and other
tools. I tried to use the upstream build for the 'capture' tool but the
upstream project pulls in extra deps and modifies several top level
CMake options.

* Before, `IREE_BUILD_TRACY` would build `iree-tracy-profiler`,
`iree-tracy-capture`, and `iree-tracy-csvexport` tools
* Now, `IREE_BUILD_TRACY` just builds `iree-tracy-capture`

Both before and after this change, a `iree-tracy-capture` tool is
bundled into the runtime Python bindings.

---------

Signed-off-by: Scott Todd <scott.todd0@gmail.com>
Signed-off-by: Lubo Litchev <lubol@google.com>
@ScottTodd ScottTodd self-assigned this Jan 29, 2025
ScottTodd added a commit that referenced this issue Jan 29, 2025
…19842)

Closes #19801 (this is an alternate
version of that PR).

This updates us from [Tracy
v0.11.0](https://github.com/wolfpld/tracy/releases/tag/v0.11.0) (at
wolfpld/tracy@0753956)
to a development version of v0.11.2 at
wolfpld/tracy@5479a42.

The relevant sections of the upstream changelog [can be viewed
here](https://github.com/wolfpld/tracy/blob/5479a42ef9346b64e6d1b860ae58aa8abdb0c7f6/NEWS#L5-L65).
Notably for our usage:

* csvexport improvements, including support for exporting plots and GPU
zones
* UI improvements, including a new flame graph feature
* More bundled dependencies, letting us prune some dockerfiles and build
scripts
* The dependency on TBB, installed at the system level, was replaced
with a source dependency on https://github.com/GabTux/PPQSort
* (From 0.11.0) Tracy supports using a known version of the capstone
library, rather than a system install. We now use this, fixing
#16777.
ita9naiwa pushed a commit to ita9naiwa/iree that referenced this issue Feb 4, 2025
…ree-org#19842)

Closes iree-org#19801 (this is an alternate
version of that PR).

This updates us from [Tracy
v0.11.0](https://github.com/wolfpld/tracy/releases/tag/v0.11.0) (at
wolfpld/tracy@0753956)
to a development version of v0.11.2 at
wolfpld/tracy@5479a42.

The relevant sections of the upstream changelog [can be viewed
here](https://github.com/wolfpld/tracy/blob/5479a42ef9346b64e6d1b860ae58aa8abdb0c7f6/NEWS#L5-L65).
Notably for our usage:

* csvexport improvements, including support for exporting plots and GPU
zones
* UI improvements, including a new flame graph feature
* More bundled dependencies, letting us prune some dockerfiles and build
scripts
* The dependency on TBB, installed at the system level, was replaced
with a source dependency on https://github.com/GabTux/PPQSort
* (From 0.11.0) Tracy supports using a known version of the capstone
library, rather than a system install. We now use this, fixing
iree-org#16777.

Signed-off-by: Hyunsung Lee <ita9naiwa@gmail.com>
@ScottTodd
Copy link
Member

Fixed by #19842

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