Tools

Architecture

class tests.tools.test_architecture.TestComputeCapabilityView on GitHub

Bases: object

Tests for reprospect.tools.architecture.ComputeCapability.

test_from_int() NoneView on GitHub
test_lt() NoneView on GitHub
test_supported() NoneView on GitHub

Test reprospect.tools.architecture.ComputeCapability.supported().

class tests.tools.test_architecture.TestNVIDIAArchView on GitHub

Bases: object

Tests for reprospect.tools.architecture.NVIDIAArch.

test_as_compute() NoneView on GitHub
test_as_sm() NoneView on GitHub
test_cc_cycle(parameters: Parameters) NoneView on GitHub
test_from_compute_capability() NoneView on GitHub
test_from_str() NoneView on GitHub
test_in_cuda_support(parameters: Parameters) NoneView on GitHub
test_repr() NoneView on GitHub
test_str() NoneView on GitHub
test_str_cycle(parameters: Parameters) NoneView on GitHub
class tests.tools.test_architecture.TestNVIDIAFamilyView on GitHub

Bases: object

Tests for reprospect.tools.architecture.NVIDIAFamily.

test_from_compute_capability() NoneView on GitHub
test_from_string() NoneView on GitHub
test_to_string() NoneView on GitHub

Binaries

Cacher

class tests.tools.test_cacher.DummyImplementation(directory: str | Path)View on GitHub

Bases: Cacher

TABLE: ClassVar[str] = 'dummy'

Name of the table.

populate(directory: Path, **kwargs) AnyView on GitHub
class tests.tools.test_cacher.TestCacherView on GitHub

Bases: object

Tests for reprospect.tools.cacher.Cacher.

test_cache_hit() NoneView on GitHub

Check that calling reprospect.tools.cacher.Cacher.get() for the second time leads to a cache hit.

test_cache_miss() NoneView on GitHub

Check that calling reprospect.tools.cacher.Cacher.get() for the first time leads to a cache miss.

test_hash_different() NoneView on GitHub

Check that calling reprospect.tools.cacher.Cacher.hash() twice with different values returns different hashes.

test_hash_same() NoneView on GitHub

Check that calling reprospect.tools.cacher.Cacher.hash() twice with the same values returns the same hash.

Device properties

class tests.tools.test_device_properties.TestCuda(methodName='runTest')View on GitHub

Bases: TestCase

Test for reprospect.tools.device_properties.Cuda.

test_check_driver_status() NoneView on GitHub

Check the proper handling of CUDA driver API error codes.

test_check_runtime_status() NoneView on GitHub

Check the proper handling of CUDA runtime API error codes.

test_device_count() NoneView on GitHub

There must be at least one device.

test_get_device_attribute() NoneView on GitHub

Retrieve a few device attributes.

test_get_device_compute_capability() NoneView on GitHub

Retrieve the compute capability of all devices available.

test_get_device_name() NoneView on GitHub

Get the device name.

test_get_device_total_memory() NoneView on GitHub

Get the device total memory.

test_initialize() NoneView on GitHub

Test it can be successfully loaded.

Nsight Compute

class tests.tools.test_ncu.TestCacherView on GitHub

Bases: object

Tests for reprospect.tools.ncu.Cacher.

GRAPH: Final[Path] = PosixPath('tests/assets/tests_assets_graph')
SAXPY: Final[Path] = PosixPath('tests/assets/tests_assets_saxpy')
test_cache_hit(bindir, workdir) NoneView on GitHub

The cacher should hit on the second call.

test_hash_different(bindir) NoneView on GitHub

Test reprospect.tools.ncu.Cacher.hash().

test_hash_same(bindir) NoneView on GitHub

Test reprospect.tools.ncu.Cacher.hash().

class tests.tools.test_ncu.TestCommandView on GitHub

Bases: object

Tests for reprospect.tools.ncu.Command.

test_env(bindir: Path) NoneView on GitHub

Check that the environment is handled properly.

class tests.tools.test_ncu.TestProfilingResultsView on GitHub

Bases: object

Tests for reprospect.tools.ncu.ProfilingResults.

results() ProfilingResultsView on GitHub
test_aggregate_metrics() NoneView on GitHub

Test reprospect.tools.ncu.ProfilingResults.aggregate_metrics().

test_assign_metrics() NoneView on GitHub

Test reprospect.tools.ncu.ProfilingResults.assign_metrics().

test_iter_metrics(results: ProfilingResults) NoneView on GitHub

Test reprospect.tools.ncu.ProfilingResults.iter_metrics().

test_query(results: ProfilingResults) NoneView on GitHub

Test reprospect.tools.ncu.ProfilingResults.query().

test_query_filter(results: ProfilingResults) NoneView on GitHub

Test reprospect.tools.ncu.ProfilingResults.query_filter().

test_query_metrics(results: ProfilingResults) NoneView on GitHub

Test reprospect.tools.ncu.ProfilingResults.query_metrics().

test_query_single_next(results: ProfilingResults) NoneView on GitHub

Test reprospect.tools.ncu.ProfilingResults.query_single_next().

test_query_single_next_metrics(results: ProfilingResults) NoneView on GitHub

Test reprospect.tools.ncu.ProfilingResults.query_single_next_metrics().

test_string_representation(results: ProfilingResults) NoneView on GitHub

Test the string representation of reprospect.tools.ncu.ProfilingResults().

class tests.tools.test_ncu.TestSessionView on GitHub

Bases: object

Test reprospect.tools.ncu.Session.

GRAPH: Final[Path] = PosixPath('tests/assets/tests_assets_graph')
SAXPY: Final[Path] = PosixPath('tests/assets/tests_assets_saxpy')
pytestmark = [Mark(name='skipif', args=(True,), kwargs={'reason': 'needs a GPU'})]
test_collect_basic_metrics_graph(bindir, workdir, cmake_cuda_compiler: dict) NoneView on GitHub

Collect a few basic metrics for the GRAPH executable.

test_collect_basic_metrics_saxpy_with_nvtx_filtering(bindir, workdir) NoneView on GitHub

Collect a few basic metrics for the SAXPY executable and filter by NVTX.

test_collect_correlated_metrics_saxpy(bindir, workdir) NoneView on GitHub

Collect metrics with correlations for the SAXPY executable.

test_fails_correctly_with_retries(bindir, workdir) NoneView on GitHub

When retries is given, but ncu fails for a good reason, it should not retry, i.e. it should not sleep.

tests.tools.test_ncu.cmake_cuda_compiler(cmake_file_api) dictView on GitHub

Nsight Systems

class tests.tools.test_nsys.TestCacherView on GitHub

Bases: object

Tests for reprospect.tools.nsys.Cacher.

GRAPH: Final[Path] = PosixPath('tests/assets/tests_assets_graph')
SAXPY: Final[Path] = PosixPath('tests/assets/tests_assets_saxpy')
test_cache_hit(bindir, workdir) NoneView on GitHub

The cacher should hit on the second call.

test_hash_different(bindir) NoneView on GitHub

Test reprospect.tools.ncu.Cacher.hash().

test_hash_same(bindir) NoneView on GitHub

Test reprospect.tools.nsys.Cacher.hash().

class tests.tools.test_nsys.TestCommandView on GitHub

Bases: object

Tests for reprospect.tools.nsys.Command.

test_env(bindir: Path) NoneView on GitHub

Check that the environment is handled properly.

class tests.tools.test_nsys.TestReportView on GitHub

Bases: object

Test reprospect.tools.nsys.Report.

class TestReportNvtxEventsView on GitHub

Bases: object

Tests for reprospect.tools.nsys.ReportNvtxEvents.

test_get(report) NoneView on GitHub

Test reprospect.tools.nsys.ReportNvtxEvents.get().

test_intricate(workdir) NoneView on GitHub

Use tests.assets.test_nvtx.TestNVTX.intricate to check that we can build the hierarchy of NVTX events for arbitrarily complicated situations.

test_string_representation(report) NoneView on GitHub

Test the string representation of reprospect.tools.nsys.ReportNvtxEvents().

pytestmark = [Mark(name='skipif', args=(True,), kwargs={'reason': 'needs a GPU'})]
report(bindir, workdir: Path) ReportView on GitHub
test_get_events_within_nested_nvtx_ranges(report) NoneView on GitHub

Check that we can retrieve from a table events that happen in a nested NVTX range.

class tests.tools.test_nsys.TestSessionView on GitHub

Bases: object

Test reprospect.tools.nsys.Session.

EXECUTABLE: Final[Path] = PosixPath('tests/assets/tests_assets_saxpy')
pytestmark = [Mark(name='skipif', args=(True,), kwargs={'reason': 'needs a GPU'})]
run(bindir: Path, cwd: Path, nvtx_capture: str | None = None) SessionView on GitHub
test_cuda_api_trace(bindir, workdir) NoneView on GitHub

Collect all CUDA API calls of tests/assets/test_saxpy.cpp.

test_report(bindir, workdir) NoneView on GitHub

Process the nsys report with reprospect.tools.nsys.Report.

class tests.tools.test_nsys.TestTracingResultsView on GitHub

Bases: object

Test string representation of tracing results.

CUDA_API_TRACE: Final[DataFrame] = Start (us)  Duration (us)  ... T-Pri    Thread Name 0  176741.213          0.942  ...    20  tests_assets_ 1  176855.658      87265.752  ...    20  tests_assets_ 2  266224.028          1.753  ...    20  tests_assets_  [3 rows x 9 columns]
test() NoneView on GitHub

Test string representation of tracing results through conversion to a rich.table.Table.

SASS