tritonparse 0.1.1__tar.gz → 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of tritonparse might be problematic. Click here for more details.

Files changed (124) hide show
  1. tritonparse-0.2.0/.ci/README.md +122 -0
  2. tritonparse-0.2.0/.ci/install-project.sh +33 -0
  3. tritonparse-0.2.0/.ci/install-triton-pip.sh +67 -0
  4. tritonparse-0.2.0/.ci/install-triton.sh +195 -0
  5. tritonparse-0.2.0/.ci/run-tests.sh +100 -0
  6. tritonparse-0.2.0/.ci/setup.sh +186 -0
  7. tritonparse-0.2.0/.github/PAGES_SETUP.md +141 -0
  8. tritonparse-0.2.0/.github/copilot-instructions.md +47 -0
  9. tritonparse-0.2.0/.github/workflows/deploy-pages-standalone.yml +59 -0
  10. tritonparse-0.2.0/.github/workflows/deploy-pages.yml +62 -0
  11. tritonparse-0.2.0/.github/workflows/nightly-pypi.yml +68 -0
  12. tritonparse-0.2.0/.github/workflows/test.yml +213 -0
  13. tritonparse-0.2.0/.gitignore +72 -0
  14. tritonparse-0.2.0/CHANGELOG.md +91 -0
  15. tritonparse-0.2.0/CODE_OF_CONDUCT.md +80 -0
  16. tritonparse-0.2.0/CONTRIBUTING.md +34 -0
  17. tritonparse-0.2.0/Makefile +58 -0
  18. tritonparse-0.2.0/PKG-INFO +139 -0
  19. tritonparse-0.2.0/docs/README.md +13 -0
  20. tritonparse-0.2.0/docs/screenshots/code-comparison.png +0 -0
  21. tritonparse-0.2.0/docs/screenshots/kernel-overview.png +0 -0
  22. {tritonparse-0.1.1 → tritonparse-0.2.0}/pyproject.toml +14 -3
  23. tritonparse-0.2.0/run.py +14 -0
  24. tritonparse-0.2.0/tests/README.md +196 -0
  25. tritonparse-0.2.0/tests/example_output/logs/dedicated_log_triton_trace_findhao_.ndjson +2 -0
  26. tritonparse-0.2.0/tests/example_output/parsed_output/dedicated_log_triton_trace_findhao__mapped.ndjson.gz +0 -0
  27. tritonparse-0.2.0/tests/example_output/parsed_output/f0_fc0_a0_cai-.ndjson.gz +0 -0
  28. tritonparse-0.2.0/tests/example_output/parsed_output/log_file_list.json +10 -0
  29. tritonparse-0.2.0/tests/example_output/parsed_output_complex/dedicated_log_triton_trace_findhao__mapped.ndjson.gz +0 -0
  30. tritonparse-0.2.0/tests/example_output/parsed_output_complex/log_file_list.json +8 -0
  31. {tritonparse-0.1.1 → tritonparse-0.2.0}/tests/test_tritonparse.py +22 -4
  32. tritonparse-0.2.0/tritonparse/__init__.py +0 -0
  33. {tritonparse-0.1.1 → tritonparse-0.2.0}/tritonparse/structured_logging.py +29 -5
  34. tritonparse-0.2.0/tritonparse/tools/__init__.py +0 -0
  35. tritonparse-0.2.0/tritonparse/tools/readme.md +1 -0
  36. tritonparse-0.2.0/tritonparse.egg-info/PKG-INFO +139 -0
  37. tritonparse-0.2.0/tritonparse.egg-info/SOURCES.txt +100 -0
  38. tritonparse-0.2.0/website/eslint.config.js +28 -0
  39. tritonparse-0.2.0/website/index.html +14 -0
  40. tritonparse-0.2.0/website/package-lock.json +4741 -0
  41. tritonparse-0.2.0/website/package.json +42 -0
  42. tritonparse-0.2.0/website/postcss.config.js +6 -0
  43. tritonparse-0.2.0/website/public/dedicated_log_triton_trace_findhao__mapped.ndjson.gz +0 -0
  44. tritonparse-0.2.0/website/public/f0_fc0_a0_cai-.ndjson +7 -0
  45. tritonparse-0.2.0/website/public/favicon.ico +0 -0
  46. tritonparse-0.2.0/website/public/logo.svg +210 -0
  47. tritonparse-0.2.0/website/scripts/inline-html.js +172 -0
  48. tritonparse-0.2.0/website/src/App.css +2 -0
  49. tritonparse-0.2.0/website/src/App.tsx +552 -0
  50. tritonparse-0.2.0/website/src/assets/react.svg +1 -0
  51. tritonparse-0.2.0/website/src/components/ArgumentViewer.tsx +274 -0
  52. tritonparse-0.2.0/website/src/components/Callstack.tsx +25 -0
  53. tritonparse-0.2.0/website/src/components/CodeComparisonView.tsx +419 -0
  54. tritonparse-0.2.0/website/src/components/CodeViewer.tsx +619 -0
  55. tritonparse-0.2.0/website/src/components/CompilationInfo.tsx +96 -0
  56. tritonparse-0.2.0/website/src/components/CopyCodeButton.tsx +61 -0
  57. tritonparse-0.2.0/website/src/components/DataSourceSelector.tsx +146 -0
  58. tritonparse-0.2.0/website/src/components/DiffViewer.tsx +96 -0
  59. tritonparse-0.2.0/website/src/components/ExternalLink.tsx +29 -0
  60. tritonparse-0.2.0/website/src/components/SingleCodeViewer.tsx +148 -0
  61. tritonparse-0.2.0/website/src/components/StackDiffViewer.tsx +82 -0
  62. tritonparse-0.2.0/website/src/components/ToggleSwitch.tsx +53 -0
  63. tritonparse-0.2.0/website/src/components/TritonIRs.tsx +94 -0
  64. tritonparse-0.2.0/website/src/components/WelcomeScreen.tsx +183 -0
  65. tritonparse-0.2.0/website/src/index.css +76 -0
  66. tritonparse-0.2.0/website/src/main.tsx +10 -0
  67. tritonparse-0.2.0/website/src/pages/CodeView.tsx +267 -0
  68. tritonparse-0.2.0/website/src/pages/KernelOverview.tsx +435 -0
  69. tritonparse-0.2.0/website/src/utils/dataLoader.ts +510 -0
  70. tritonparse-0.2.0/website/src/utils/fbDetection.ts +22 -0
  71. tritonparse-0.2.0/website/src/utils/safeImport.ts +29 -0
  72. tritonparse-0.2.0/website/src/utils/tensor.ts +109 -0
  73. tritonparse-0.2.0/website/src/vite-env.d.ts +11 -0
  74. tritonparse-0.2.0/website/tailwind.config.js +8 -0
  75. tritonparse-0.2.0/website/tsconfig.app.json +26 -0
  76. tritonparse-0.2.0/website/tsconfig.json +7 -0
  77. tritonparse-0.2.0/website/tsconfig.node.json +24 -0
  78. tritonparse-0.2.0/website/vite.config.ts +83 -0
  79. tritonparse-0.1.1/PKG-INFO +0 -10
  80. tritonparse-0.1.1/tests/test_add2.py +0 -81
  81. tritonparse-0.1.1/tests/test_reproducer.py +0 -128
  82. tritonparse-0.1.1/tritonparse/reproducer/__init__.py +0 -21
  83. tritonparse-0.1.1/tritonparse/reproducer/__main__.py +0 -81
  84. tritonparse-0.1.1/tritonparse/reproducer/cli.py +0 -37
  85. tritonparse-0.1.1/tritonparse/reproducer/config.py +0 -15
  86. tritonparse-0.1.1/tritonparse/reproducer/factory.py +0 -16
  87. tritonparse-0.1.1/tritonparse/reproducer/ingestion/__init__.py +0 -6
  88. tritonparse-0.1.1/tritonparse/reproducer/ingestion/ndjson.py +0 -165
  89. tritonparse-0.1.1/tritonparse/reproducer/orchestrator.py +0 -65
  90. tritonparse-0.1.1/tritonparse/reproducer/param_generator.py +0 -142
  91. tritonparse-0.1.1/tritonparse/reproducer/prompts/__init__.py +0 -1
  92. tritonparse-0.1.1/tritonparse/reproducer/prompts/loader.py +0 -18
  93. tritonparse-0.1.1/tritonparse/reproducer/providers/__init__.py +0 -1
  94. tritonparse-0.1.1/tritonparse/reproducer/providers/base.py +0 -14
  95. tritonparse-0.1.1/tritonparse/reproducer/providers/gemini.py +0 -47
  96. tritonparse-0.1.1/tritonparse/reproducer/runtime/__init__.py +0 -1
  97. tritonparse-0.1.1/tritonparse/reproducer/runtime/executor.py +0 -13
  98. tritonparse-0.1.1/tritonparse/reproducer/utils/io.py +0 -6
  99. tritonparse-0.1.1/tritonparse.egg-info/PKG-INFO +0 -10
  100. tritonparse-0.1.1/tritonparse.egg-info/SOURCES.txt +0 -47
  101. {tritonparse-0.1.1 → tritonparse-0.2.0}/LICENSE +0 -0
  102. {tritonparse-0.1.1 → tritonparse-0.2.0}/README.md +0 -0
  103. {tritonparse-0.1.1/tritonparse → tritonparse-0.2.0}/__init__.py +0 -0
  104. {tritonparse-0.1.1 → tritonparse-0.2.0}/setup.cfg +0 -0
  105. {tritonparse-0.1.1/tritonparse/tools → tritonparse-0.2.0/tests}/__init__.py +0 -0
  106. {tritonparse-0.1.1 → tritonparse-0.2.0}/tests/test_add.py +0 -0
  107. {tritonparse-0.1.1 → tritonparse-0.2.0}/tritonparse/common.py +0 -0
  108. {tritonparse-0.1.1 → tritonparse-0.2.0}/tritonparse/event_diff.py +0 -0
  109. {tritonparse-0.1.1 → tritonparse-0.2.0}/tritonparse/extract_source_mappings.py +0 -0
  110. {tritonparse-0.1.1 → tritonparse-0.2.0}/tritonparse/ir_parser.py +0 -0
  111. {tritonparse-0.1.1 → tritonparse-0.2.0}/tritonparse/mapper.py +0 -0
  112. {tritonparse-0.1.1 → tritonparse-0.2.0}/tritonparse/shared_vars.py +0 -0
  113. {tritonparse-0.1.1 → tritonparse-0.2.0}/tritonparse/source_type.py +0 -0
  114. {tritonparse-0.1.1 → tritonparse-0.2.0}/tritonparse/sourcemap_utils.py +0 -0
  115. {tritonparse-0.1.1 → tritonparse-0.2.0}/tritonparse/tools/decompress_bin_ndjson.py +0 -0
  116. {tritonparse-0.1.1 → tritonparse-0.2.0}/tritonparse/tools/format_fix.py +0 -0
  117. {tritonparse-0.1.1 → tritonparse-0.2.0}/tritonparse/tools/load_tensor.py +0 -0
  118. {tritonparse-0.1.1 → tritonparse-0.2.0}/tritonparse/tools/prettify_ndjson.py +0 -0
  119. {tritonparse-0.1.1 → tritonparse-0.2.0}/tritonparse/tp_logger.py +0 -0
  120. {tritonparse-0.1.1 → tritonparse-0.2.0}/tritonparse/trace_processor.py +0 -0
  121. {tritonparse-0.1.1 → tritonparse-0.2.0}/tritonparse/utils.py +0 -0
  122. {tritonparse-0.1.1 → tritonparse-0.2.0}/tritonparse.egg-info/dependency_links.txt +0 -0
  123. {tritonparse-0.1.1 → tritonparse-0.2.0}/tritonparse.egg-info/requires.txt +0 -0
  124. {tritonparse-0.1.1 → tritonparse-0.2.0}/tritonparse.egg-info/top_level.txt +0 -0
@@ -0,0 +1,122 @@
1
+ # CI Scripts
2
+
3
+ This directory contains scripts for setting up and running the tritonparse CI environment.
4
+
5
+ ## Scripts Overview
6
+
7
+ ### `setup.sh`
8
+ Sets up the conda environment, installs dependencies, configures CUDA, and installs cuDNN.
9
+
10
+ **Environment Variables:**
11
+ - `CONDA_ENV`: Conda environment name (default: "tritonparse")
12
+ - `PYTHON_VERSION`: Python version (default: "3.11")
13
+ - `CUDA_VERSION`: CUDA version (default: "12.8")
14
+ - `CUDNN_VERSION`: cuDNN version (default: "9.10.2.21")
15
+
16
+ **Usage:**
17
+ ```bash
18
+ CONDA_ENV=tritonparse PYTHON_VERSION=3.11 bash .ci/setup.sh
19
+ ```
20
+
21
+ > **Note:**
22
+ > `setup.sh` will automatically download and execute the official PyTorch cuDNN installation script from:
23
+ > https://github.com/pytorch/pytorch/blob/main/.ci/docker/common/install_cudnn.sh
24
+ > There is no need to maintain a local cuDNN install script.
25
+
26
+ ### `install-triton.sh`
27
+ Installs Triton from source by cloning the repository and building it.
28
+
29
+ **Environment Variables:**
30
+ - `CONDA_ENV`: Conda environment name (required)
31
+
32
+ **Usage:**
33
+ ```bash
34
+ CONDA_ENV=tritonparse bash .ci/install-triton.sh
35
+ ```
36
+
37
+ ### `install-project.sh`
38
+ Installs the tritonparse project in editable mode with test dependencies.
39
+
40
+ **Environment Variables:**
41
+ - `CONDA_ENV`: Conda environment name (required)
42
+
43
+ **Usage:**
44
+ ```bash
45
+ CONDA_ENV=tritonparse bash .ci/install-project.sh
46
+ ```
47
+
48
+ ### `run-tests.sh`
49
+ Runs the test suite with proper environment setup.
50
+
51
+ **Environment Variables:**
52
+ - `CONDA_ENV`: Conda environment name (required)
53
+ - `TEST_TYPE`: Type of tests to run (default: "all")
54
+ - `cpu`: CPU tests only
55
+ - `cuda`: CUDA tests only
56
+ - `all`: All tests
57
+ - `VERBOSE`: Enable verbose output (default: "true")
58
+ - `COVERAGE`: Enable coverage reporting (default: "false")
59
+
60
+ **Usage:**
61
+ ```bash
62
+ # Run all tests
63
+ CONDA_ENV=tritonparse bash .ci/run-tests.sh
64
+
65
+ # Run CPU tests only with coverage
66
+ CONDA_ENV=tritonparse TEST_TYPE=cpu COVERAGE=true bash .ci/run-tests.sh
67
+
68
+ # Run CUDA tests only
69
+ CONDA_ENV=tritonparse TEST_TYPE=cuda bash .ci/run-tests.sh
70
+ ```
71
+
72
+ ## Complete Workflow
73
+
74
+ For a complete setup and test run:
75
+
76
+ ```bash
77
+ # 1. Setup environment (includes cuDNN installation)
78
+ CONDA_ENV=tritonparse PYTHON_VERSION=3.11 bash .ci/setup.sh
79
+
80
+ # 2. Install Triton
81
+ CONDA_ENV=tritonparse bash .ci/install-triton.sh
82
+
83
+ # 3. Install project
84
+ CONDA_ENV=tritonparse bash .ci/install-project.sh
85
+
86
+ # 4. Run tests
87
+ CONDA_ENV=tritonparse TEST_TYPE=all COVERAGE=true bash .ci/run-tests.sh
88
+ ```
89
+
90
+ ## Local Development
91
+
92
+ For local development, you can use these scripts to set up the same environment as CI:
93
+
94
+ ```bash
95
+ # Setup local environment (includes cuDNN installation)
96
+ CONDA_ENV=tritonparse-local bash .ci/setup.sh
97
+
98
+ # Install Triton
99
+ CONDA_ENV=tritonparse-local bash .ci/install-triton.sh
100
+
101
+ # Install project
102
+ CONDA_ENV=tritonparse-local bash .ci/install-project.sh
103
+
104
+ # Run tests
105
+ CONDA_ENV=tritonparse-local bash .ci/run-tests.sh
106
+ ```
107
+
108
+ ## Script Features
109
+
110
+ - **Error handling**: All scripts use `set -e` to stop on errors
111
+ - **Environment validation**: Scripts check for required environment variables
112
+ - **Verbose output**: Detailed logging for debugging
113
+ - **Modular design**: Each script has a single responsibility
114
+ - **Reusable**: Scripts can be used in different contexts (CI, local development)
115
+
116
+ ## Dependencies
117
+
118
+ The scripts assume:
119
+ - Linux environment
120
+ - Git available
121
+ - Internet access for downloading packages
122
+ - Sufficient disk space for conda and packages
@@ -0,0 +1,33 @@
1
+ #!/bin/bash
2
+
3
+ # Install tritonparse project dependencies
4
+ # This script installs the project in editable mode with test dependencies
5
+
6
+ set -e
7
+
8
+ echo "Installing tritonparse project dependencies..."
9
+
10
+ # Ensure we're in the conda environment
11
+ if [ -z "$CONDA_ENV" ]; then
12
+ echo "ERROR: CONDA_ENV is not set"
13
+ exit 1
14
+ fi
15
+
16
+ # Activate conda environment
17
+ source /opt/miniconda3/etc/profile.d/conda.sh
18
+ conda activate "$CONDA_ENV"
19
+
20
+ # Upgrade pip
21
+ echo "Upgrading pip..."
22
+ python -m pip install --upgrade pip
23
+
24
+ # Install project in editable mode with test dependencies
25
+ echo "Installing tritonparse in editable mode..."
26
+ pip install -e ".[test]"
27
+
28
+ # Verify installation
29
+ echo "Verifying installation..."
30
+ python -c "import tritonparse; print(f'tritonparse installed successfully')"
31
+ python -c "import coverage; print(f'coverage version: {coverage.__version__}')"
32
+
33
+ echo "Project installation completed successfully!"
@@ -0,0 +1,67 @@
1
+ #!/bin/bash
2
+
3
+ # Install Triton from pip
4
+ # This script installs the latest version of Triton from PyPI.
5
+
6
+ set -e
7
+
8
+ echo "🚀 Installing Triton from pip..."
9
+ START_TIME=$(date +%s)
10
+
11
+ # Function to show elapsed time
12
+ show_elapsed() {
13
+ CURRENT_TIME=$(date +%s)
14
+ ELAPSED=$((CURRENT_TIME - START_TIME))
15
+ echo "⏱️ Elapsed time: ${ELAPSED}s"
16
+ }
17
+
18
+ # Pre-flight checks
19
+ echo "🔍 Running pre-flight checks..."
20
+
21
+ # Ensure we're in the conda environment
22
+ if [ -z "$CONDA_ENV" ]; then
23
+ echo "ERROR: CONDA_ENV is not set"
24
+ exit 1
25
+ fi
26
+
27
+ # Activate conda environment
28
+ source /opt/miniconda3/etc/profile.d/conda.sh
29
+ conda activate "$CONDA_ENV"
30
+
31
+ # Uninstall existing triton to avoid conflicts
32
+ echo "Uninstalling existing Triton versions..."
33
+ pip uninstall -y pytorch-triton triton || true
34
+
35
+ # Install Triton from pip
36
+ echo "Installing the latest Triton from PyPI..."
37
+ pip install triton
38
+
39
+ show_elapsed
40
+
41
+ # Verify Triton installation
42
+ echo "Verifying Triton installation..."
43
+
44
+ set +e # Temporarily disable exit on error
45
+ IMPORT_OUTPUT=$(python -c "import triton; print(f'Triton version: {triton.__version__}')" 2>&1)
46
+ IMPORT_EXITCODE=$?
47
+ set -e # Re-enable exit on error
48
+
49
+ echo "Import exit code: $IMPORT_EXITCODE"
50
+ echo "Import output: $IMPORT_OUTPUT"
51
+
52
+ if [ $IMPORT_EXITCODE -eq 0 ]; then
53
+ echo "$IMPORT_OUTPUT"
54
+ python -c "import triton; print(f'Triton path: {triton.__file__}')"
55
+ echo "✅ Triton installation verified successfully"
56
+ show_elapsed
57
+ echo "🎉 Triton installation completed successfully!"
58
+ else
59
+ echo "❌ ERROR: Failed to import Triton"
60
+ echo "Import error details:"
61
+ echo "$IMPORT_OUTPUT"
62
+ echo ""
63
+ echo "Additional diagnostic information:"
64
+ echo "Installed packages containing 'triton':"
65
+ pip list | grep -i triton || echo "No triton packages found"
66
+ exit 1
67
+ fi
@@ -0,0 +1,195 @@
1
+ #!/bin/bash
2
+
3
+ # Install Triton from source
4
+ # This script clones and installs Triton from the main repository
5
+
6
+ set -e
7
+
8
+ echo "🚀 Installing Triton from source..."
9
+ START_TIME=$(date +%s)
10
+
11
+ # Function to show elapsed time
12
+ show_elapsed() {
13
+ CURRENT_TIME=$(date +%s)
14
+ ELAPSED=$((CURRENT_TIME - START_TIME))
15
+ echo "⏱️ Elapsed time: ${ELAPSED}s"
16
+ }
17
+
18
+ # Pre-flight checks
19
+ echo "🔍 Running pre-flight checks..."
20
+
21
+ # Set Triton version/commit for cache consistency
22
+ TRITON_COMMIT=${TRITON_COMMIT:-"main"}
23
+ echo "🎯 Target Triton commit/branch: $TRITON_COMMIT"
24
+ TRITON_CACHE_DIR="/tmp/triton-cache"
25
+ TRITON_SOURCE_DIR="/tmp/triton"
26
+
27
+ # Check disk space (need at least 10GB for Triton compilation)
28
+ AVAILABLE_SPACE=$(df /tmp | tail -1 | awk '{print $4}')
29
+ REQUIRED_SPACE=10485760 # 10GB in KB
30
+ if [ "$AVAILABLE_SPACE" -lt "$REQUIRED_SPACE" ]; then
31
+ echo "⚠️ WARNING: Low disk space. Available: $(($AVAILABLE_SPACE / 1024 / 1024))GB, Recommended: 10GB"
32
+ else
33
+ echo "✅ Sufficient disk space available: $(($AVAILABLE_SPACE / 1024 / 1024))GB"
34
+ fi
35
+
36
+ # Ensure we're in the conda environment
37
+ if [ -z "$CONDA_ENV" ]; then
38
+ echo "ERROR: CONDA_ENV is not set"
39
+ exit 1
40
+ fi
41
+
42
+ # Activate conda environment
43
+ source /opt/miniconda3/etc/profile.d/conda.sh
44
+ conda activate "$CONDA_ENV"
45
+
46
+ # Create cache directory
47
+ mkdir -p "$TRITON_CACHE_DIR"
48
+
49
+ # Check if we have cached source with correct commit
50
+ if [ -f "$TRITON_CACHE_DIR/commit" ] && [ -d "$TRITON_SOURCE_DIR" ]; then
51
+ CACHED_COMMIT=$(cat "$TRITON_CACHE_DIR/commit")
52
+ if [ "$CACHED_COMMIT" = "$TRITON_COMMIT" ] && [ "$TRITON_COMMIT" != "main" ]; then
53
+ echo "Found cached Triton source with correct commit ($CACHED_COMMIT)"
54
+ echo "Will use cached source and re-install to new conda environment"
55
+ USE_CACHED_SOURCE=true
56
+ elif [ "$TRITON_COMMIT" = "main" ]; then
57
+ echo "Target is 'main' branch (API fallback), will rebuild from scratch"
58
+ echo "Cached commit: $CACHED_COMMIT"
59
+ USE_CACHED_SOURCE=false
60
+ else
61
+ echo "Cached source commit mismatch: cached=$CACHED_COMMIT, target=$TRITON_COMMIT"
62
+ echo "Will rebuild from scratch"
63
+ USE_CACHED_SOURCE=false
64
+ fi
65
+ else
66
+ echo "No cached source found or no commit info, will build from scratch"
67
+ USE_CACHED_SOURCE=false
68
+ fi
69
+
70
+ # Update libstdc++ to match system version
71
+ # Otherwise, we get errors like:
72
+ # ImportError: /opt/miniconda3/envs/tritonparse/bin/../lib/libstdc++.so.6:
73
+ # version `GLIBCXX_3.4.30' not found (required by /tmp/triton/python/triton/_C/libtriton.so)
74
+ echo "Updating libstdc++ to match system version..."
75
+ # Use the latest version for Ubuntu 22.04 that includes GLIBCXX_3.4.32
76
+ conda install -y -c conda-forge libstdcxx-ng=15.1.0
77
+ # Check if the update was successful
78
+ echo "Checking libstdc++ version after update:"
79
+ strings /opt/miniconda3/envs/tritonparse/lib/libstdc++.so.6 | grep GLIBCXX | tail -10
80
+
81
+ # Uninstall existing pytorch-triton
82
+ echo "Uninstalling existing pytorch-triton..."
83
+ pip uninstall -y pytorch-triton || true
84
+ pip uninstall -y triton || true
85
+
86
+ # Setup Triton repository based on cache status
87
+ if [ "$USE_CACHED_SOURCE" = "true" ]; then
88
+ echo "Using cached Triton source..."
89
+ cd "$TRITON_SOURCE_DIR"
90
+ ACTUAL_COMMIT=$(git rev-parse HEAD)
91
+ echo "Using cached Triton commit: $ACTUAL_COMMIT"
92
+ else
93
+ echo "Setting up Triton repository from scratch..."
94
+ if [ -d "$TRITON_SOURCE_DIR" ]; then
95
+ echo "Removing existing source directory..."
96
+ rm -rf "$TRITON_SOURCE_DIR"
97
+ fi
98
+
99
+ echo "Cloning Triton repository..."
100
+ if ! git clone https://github.com/triton-lang/triton.git "$TRITON_SOURCE_DIR"; then
101
+ echo "❌ ERROR: Failed to clone Triton repository"
102
+ echo "This might be due to network issues or GitHub rate limiting"
103
+ exit 1
104
+ fi
105
+
106
+ cd "$TRITON_SOURCE_DIR"
107
+
108
+ # Checkout specific commit for reproducibility
109
+ echo "Checking out commit: $TRITON_COMMIT"
110
+ if ! git checkout "$TRITON_COMMIT"; then
111
+ echo "❌ ERROR: Failed to checkout commit $TRITON_COMMIT"
112
+ echo "This might be due to an invalid commit hash or network issues"
113
+ exit 1
114
+ fi
115
+
116
+ ACTUAL_COMMIT=$(git rev-parse HEAD)
117
+ echo "✅ Using Triton commit: $ACTUAL_COMMIT"
118
+ fi
119
+
120
+ # Install build dependencies
121
+ echo "Installing build dependencies..."
122
+ pip install ninja cmake wheel pybind11
123
+
124
+ # Install Triton requirements
125
+ echo "Installing Triton requirements..."
126
+ pip install -r python/requirements.txt
127
+
128
+ # Set environment to use clang compiler for faster compilation
129
+ echo "Setting up clang compiler for faster compilation..."
130
+ export CC=clang
131
+ export CXX=clang++
132
+ echo "Using CC: $CC"
133
+ echo "Using CXX: $CXX"
134
+
135
+ # Install Triton in editable mode with clang
136
+ if [ "$USE_CACHED_SOURCE" = "true" ]; then
137
+ echo "Installing cached Triton to new conda environment..."
138
+ echo "This should be fast since build artifacts are cached"
139
+ else
140
+ echo "Compiling and installing Triton from scratch..."
141
+ echo "This will take 30-50 minutes for compilation"
142
+ fi
143
+ pip install -e .
144
+ show_elapsed
145
+
146
+ # Verify Triton installation
147
+ echo "Verifying Triton installation..."
148
+ echo "Python path: $(which python)"
149
+ echo "Python version: $(python --version)"
150
+ echo "PYTHONPATH: $PYTHONPATH"
151
+ echo "Testing basic Python functionality..."
152
+ python -c "print('Python works')" || echo "❌ Basic Python test failed"
153
+ echo "Attempting to import triton..."
154
+
155
+ set +e # Temporarily disable exit on error
156
+ IMPORT_OUTPUT=$(python -c "import triton; print(f'Triton version: {triton.__version__}')" 2>&1)
157
+ IMPORT_EXITCODE=$?
158
+ set -e # Re-enable exit on error
159
+
160
+ echo "Import exit code: $IMPORT_EXITCODE"
161
+ echo "Import output: $IMPORT_OUTPUT"
162
+
163
+ if [ $IMPORT_EXITCODE -eq 0 ]; then
164
+ echo "$IMPORT_OUTPUT"
165
+ python -c "import triton; print(f'Triton path: {triton.__file__}')"
166
+ echo "✅ Triton installation verified successfully"
167
+
168
+ # Only save commit info after successful verification
169
+ echo "$ACTUAL_COMMIT" >"$TRITON_CACHE_DIR/commit"
170
+ echo "✅ Cache information saved"
171
+
172
+ show_elapsed
173
+ echo "🎉 Triton installation completed successfully!"
174
+ else
175
+ echo "❌ ERROR: Failed to import triton"
176
+ echo "Import error details:"
177
+ echo "$IMPORT_OUTPUT"
178
+ echo ""
179
+ echo "Additional diagnostic information:"
180
+ echo "Installed packages containing 'triton':"
181
+ pip list | grep -i triton || echo "No triton packages found"
182
+ echo ""
183
+ echo "Python sys.path:"
184
+ python -c "import sys; print('\n'.join(sys.path))"
185
+ echo ""
186
+ echo "Checking if triton directory exists in site-packages:"
187
+ python -c "import site; print([p for p in site.getsitepackages()])" 2>/dev/null || echo "Could not get site-packages"
188
+ find $(python -c "import site; print(' '.join(site.getsitepackages()))" 2>/dev/null) -name "*triton*" 2>/dev/null || echo "Could not find triton in site-packages"
189
+
190
+ # Clean up cache on failure to prevent corruption
191
+ echo "🧹 Cleaning up cache due to installation failure..."
192
+ rm -f "$TRITON_CACHE_DIR/commit"
193
+
194
+ exit 1
195
+ fi
@@ -0,0 +1,100 @@
1
+ #!/bin/bash
2
+
3
+ # Run tritonparse tests
4
+ # This script runs the test suite with proper environment setup
5
+
6
+ set -e
7
+
8
+ # Default values
9
+ TEST_TYPE=${TEST_TYPE:-"all"}
10
+ VERBOSE=${VERBOSE:-"true"}
11
+ COVERAGE=${COVERAGE:-"false"}
12
+
13
+ echo "Running tritonparse tests..."
14
+ echo "TEST_TYPE: $TEST_TYPE"
15
+ echo "VERBOSE: $VERBOSE"
16
+ echo "COVERAGE: $COVERAGE"
17
+
18
+ # Ensure we're in the conda environment
19
+ if [ -z "$CONDA_ENV" ]; then
20
+ echo "ERROR: CONDA_ENV is not set"
21
+ exit 1
22
+ fi
23
+
24
+ # Activate conda environment
25
+ source /opt/miniconda3/etc/profile.d/conda.sh
26
+ conda activate "$CONDA_ENV"
27
+
28
+ # Set environment variables
29
+ # export TORCHINDUCTOR_FX_GRAPH_CACHE=0
30
+ # export TRITONPARSE_DEBUG=1
31
+
32
+ # Build unittest command based on test type
33
+ case "$TEST_TYPE" in
34
+ "cpu")
35
+ echo "Running CPU tests only..."
36
+ if [ "$COVERAGE" = "true" ]; then
37
+ echo "Running with coverage..."
38
+ if [ "$VERBOSE" = "true" ]; then
39
+ coverage run -m unittest tests.test_tritonparse.TestTritonparseCPU -v
40
+ else
41
+ coverage run -m unittest tests.test_tritonparse.TestTritonparseCPU
42
+ fi
43
+ coverage report
44
+ coverage xml
45
+ else
46
+ if [ "$VERBOSE" = "true" ]; then
47
+ python -m unittest tests.test_tritonparse.TestTritonparseCPU -v
48
+ else
49
+ python -m unittest tests.test_tritonparse.TestTritonparseCPU
50
+ fi
51
+ fi
52
+ ;;
53
+ "cuda")
54
+ echo "Running CUDA tests only..."
55
+ export CUDA_VISIBLE_DEVICES=0
56
+ if [ "$COVERAGE" = "true" ]; then
57
+ echo "Running with coverage..."
58
+ if [ "$VERBOSE" = "true" ]; then
59
+ coverage run -m unittest tests.test_tritonparse.TestTritonparseCUDA -v
60
+ else
61
+ coverage run -m unittest tests.test_tritonparse.TestTritonparseCUDA
62
+ fi
63
+ coverage report
64
+ coverage xml
65
+ else
66
+ if [ "$VERBOSE" = "true" ]; then
67
+ python -m unittest tests.test_tritonparse.TestTritonparseCUDA -v
68
+ else
69
+ python -m unittest tests.test_tritonparse.TestTritonparseCUDA
70
+ fi
71
+ fi
72
+ ;;
73
+ "all")
74
+ echo "Running all tests..."
75
+ export CUDA_VISIBLE_DEVICES=0
76
+ if [ "$COVERAGE" = "true" ]; then
77
+ echo "Running with coverage..."
78
+ if [ "$VERBOSE" = "true" ]; then
79
+ coverage run -m unittest tests.test_tritonparse -v
80
+ else
81
+ coverage run -m unittest tests.test_tritonparse
82
+ fi
83
+ coverage report
84
+ coverage xml
85
+ else
86
+ if [ "$VERBOSE" = "true" ]; then
87
+ python -m unittest tests.test_tritonparse -v
88
+ else
89
+ python -m unittest tests.test_tritonparse
90
+ fi
91
+ fi
92
+ ;;
93
+ *)
94
+ echo "Unknown test type: $TEST_TYPE"
95
+ echo "Available options: cpu, cuda, all"
96
+ exit 1
97
+ ;;
98
+ esac
99
+
100
+ echo "Tests completed successfully!"