CI: upload Python coverage.json from pytest (non-blocking) - #712
Open
jiagaoxiang wants to merge 2 commits into
Open
CI: upload Python coverage.json from pytest (non-blocking)#712jiagaoxiang wants to merge 2 commits into
jiagaoxiang wants to merge 2 commits into
Conversation
JUnit already records which tests passed. Wrap the existing pytest invocation with coverage.py so each CI job can publish which installed transformer_engine Python APIs actually ran. Export is best-effort and never uploads an empty stub.
jiagaoxiang
requested review from
ipanfilo,
wangye805 and
wenchenvincent
as code owners
August 21, 2026 22:22
Require TE_COVERAGE=1 explicitly, cd into the output dir before combining shards, pass TE_PATH/arch/suite into export metadata, and document non-pytest python gaps in coverage-meta.txt.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
transformer_enginePython functions actually ran during those tests.pytest_runis wrapped withcoverage.pyonly whenTE_COVERAGE=1(set in ROCm CI). Localci/pytorch.sh/ci/jax.shruns are unchanged unless that variable is set.python-coverage-*/coverage.jsonplus a smallcoverage-meta.txtwith the git SHA. Export is best-effort: a missing or empty report is not uploaded and does not fail the job.This is Python-only. It does not measure C++/HIP kernels (
.cu/.hip); that would need a separate instrumented build andllvm-cov.torchrun/mpirunchild processes are also not included in this first step.Test plan
python-coverage-sgpu-<arch>/python-coverage-mgpu-<arch>-<framework>is present only ifcoverage.jsonis non-empty and lists measured files.coverage-meta.txtrecords the commit SHA of that job.ci/pytorch.shwithoutTE_COVERAGE=1still invokes plainpython3 -m pytest.