sglang_v0.5.2/pytorch_2.8.0/third_party/kineto/libkineto
hailin c8e8c1e9ff . 2025-09-20 16:09:34 +08:00
..
include . 2025-09-20 16:09:34 +08:00
sample_programs . 2025-09-20 16:09:34 +08:00
src . 2025-09-20 16:09:34 +08:00
stress_test . 2025-09-20 16:09:34 +08:00
test . 2025-09-20 16:09:34 +08:00
third_party . 2025-09-20 16:09:34 +08:00
CMakeLists.txt . 2025-09-20 16:09:34 +08:00
README.md . 2025-09-20 16:09:34 +08:00
libkineto_defs.bzl . 2025-09-20 16:09:34 +08:00

README.md

Libkineto

Libkineto is an in-process profiling library, part of the Kineto performance tools project.

The library provides a way to collect GPU traces and metrics from the host process, either via the library public API or by sending a signal, if enabled.

Currently only NVIDIA GPUs are supported.

Build Notes

Libkineto uses the standard CMAKE-based build flow.

Dependencies

Libkineto requires gcc 5+ and:

  • NVIDIA CUPTI: used to collect traces and metrics from NVIDIA GPUs.
  • fmt: used for its convenient and lightweight string formatting functionality.
  • googletest: required to build and run Kineto's tests.
    • googletest is not required if you don't want to run Kineto tests. By default, building of tests is on. Turn it off by setting KINETO_BUILD_TESTS to off.

You can download NVIDIA CUPTI, fmt, googletest and set CUDA_SOURCE_DIR, FMT_SOURCE_DIR, GOOGLETEST_SOURCE_DIR respectively for cmake to find these libraries. If the fmt and googletest variables are not set, cmake will build the git submodules found in the third_party directory. If CUDA_SOURCE_DIR is not set, libkineto will fail to build.

Building Libkineto

# Check out repo and sub modules
git clone --recursive https://github.com/pytorch/kineto.git
# Build libkineto with cmake
cd kineto/libkineto
mkdir build && cd build
cmake ..
make

To run the tests after building libkineto (if tests are built), use the following command:

make test

Installing Libkineto

make install

How Libkineto works

We will provide a high-level overview, design philosophy and brief descriptions of various parts of Libkineto in upcoming blogs.

Full documentation

We strive to keep our source files readable. The best and up-to-date documentation is available in the source files.

License

Libkineto is BSD licensed, as detailed in the LICENSE file.