dotnet/runtime · error · RuntimeError
Pass only one tiering option.
Error message
Pass only one tiering option.
What it means
Raised by superpmi_benchmarks.py main() at src/coreclr/scripts/superpmi_benchmarks.py:423 when both --tiered_compilation and --tiered_pgo are passed. The two are mutually exclusive: --tiered_pgo already implies tiered compilation (it sets both DOTNET_TieredCompilation=1 and DOTNET_TieredPGO=1), and a benchmark collection must isolate a single tiering configuration.
Solutions
- Pass exactly one of --tiered_compilation or --tiered_pgo (or neither for the default).
- If you want PGO, use only --tiered_pgo.
- If you want tiered compilation without PGO, use only --tiered_compilation.
Example fix
// before python superpmi_benchmarks.py ... --tiered_compilation --tiered_pgo // after python superpmi_benchmarks.py ... --tiered_pgo
Defensive patterns
Strategy: validation
Validate before calling
if args.tiered_compilation and args.tiered_pgo:
parser.error('Pass only one tiering option: --tiered_compilation or --tiered_pgo, not both.') Prevention
- Declare the two flags in an argparse mutually exclusive group (add_mutually_exclusive_group) so argparse rejects the combination.
When it happens
Trigger: Invoking superpmi_benchmarks.py with both --tiered_compilation and --tiered_pgo on the same command line.
Common situations: Copy-pasting flags from two different pipeline jobs; assuming more flags = broader coverage.
Related errors
- Cannot find System.Private.CoreLib.dll at
- Collection 'smoke_tests' is only available for 'nativeaot'…
- {coreclr_args.mode}
- Could not determine JIT-EE version
- Invalid arch.
AI-assisted analysis of dotnet/runtime@60108ba66e (2026-08-10).
Data as JSON: /api/errors/c78c703963756b6f.
Report an issue: GitHub.
Appendix: source
Thrown at src/coreclr/scripts/superpmi_benchmarks.py:423
print(f"-strip failed. Copying {old_mch_filename} to {new_mch_filename}.")
copyfile(old_mch_filename, new_mch_filename)
copyfile(old_mch_filename + ".mct", new_mch_filename + ".mct")
return
# Create toc file
run_command([mcs_exe, "-toc", new_mch_filename])
def main(main_args):
""" Main entry point
Args:
main_args ([type]): Arguments to the script
"""
coreclr_args = setup_args(main_args)
if coreclr_args.tiered_compilation and coreclr_args.tiered_pgo:
raise RuntimeError("Pass only one tiering option.")
all_output_mch_name = os.path.join(coreclr_args.output_mch_path + "_all.mch")
build_and_run(coreclr_args, all_output_mch_name)
if os.path.isfile(all_output_mch_name):
pass
else:
print("No mch file generated.")
strip_unrelated_mc(coreclr_args, all_output_mch_name, coreclr_args.output_mch_path)
if __name__ == "__main__":
args = parser.parse_args()
sys.exit(main(args))
View on GitHub (pinned to 60108ba66e)