This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
ParEval-Repo is an LLM benchmarking suite for repository-scale translation of HPC (parallel) codes. It translates codebases between parallel programming models (e.g., CUDA → Kokkos, OpenMP-offload → CUDA) using LLMs, then builds and validates the translated code on HPC systems.
# Preferred (uses exact pinned versions)
uv sync && . .venv/bin/activate
# Alternative
pip install -r requirements.txtPython 3.11.13+ required.
python src/translate/translate.py --help
# Example: naive translation
python src/translate/translate.py \
--input targets/XSBench/openmp-offload \
--output /path/to/output \
--src-model openmp-offload \
--dst-model cuda \
--method naive \
--config config/perlmutter-config.jsonpython src/drivers/run-all.py --help
# Example
python src/drivers/run-all.py \
--translations-root /path/to/translations \
--output results.json \
--config config/perlmutter-config.json- Translation phase (
src/translate/): Takes a source repo +target.jsonfor both input and output, calls an LLM to produce translated code files. - Driver phase (
src/drivers/): Builds and runs the translated repos, comparing outputs against expected values.
Three strategies, selectable via --method:
- naive (
naive/): Translates file-by-file with full repo context in a single LLM prompt. UsesChunkFileAgentfor large files. - top-down-agentic (
top_down_agentic/): Multi-agent pipeline:DependencyAgentbuilds a file dependency tree →ChunkAgentsplits large files →ContextAgentgathers relevant context → translates each file. - swe-agent (
swe_agent/): Wraps the external SWE-agent tool for autonomous translation.
All methods inherit from Translator ABC (translator.py) and use GeneratorMixin (generator_mixin.py) for unified LLM access across backends (OpenAI, Gemini, HuggingFace, vLLM, local).
Each targets/<app>/<model>/ directory requires a target.json with:
- Build/run commands and timeouts
- Expected output strings for validation (
debug_outputs,debug_type) - File classifications (build files, main entry points)
- Dependency module names (resolved via system config)
The driver reads target.json to know how to build, run, and validate each translated repo.
JSON files per HPC system (e.g., perlmutter-config.json) that map dependency names to module load commands and set GPU architecture (sm). Passed to both translation and driver scripts via --config.
Core utility classes used throughout drivers:
CommandExecutor— runs shell commands with timeout and dry-run supportConfigManager— loads and resolves system configDataManager— persists results to JSONResultBuilder— constructs structured build/run result objects
- Create
targets/<app>/<model>/repo/with source code - Create
targets/<app>/<model>/target.jsonfollowing the schema in existing targets - Provide a
target.jsonfor both source and destination models when translating