How milanfusco/mcframework-gpu works
mcFramework-GPU is a Monte Carlo π estimation demo and CPU/GPU comparison tool. The main workflow runs scalar Python, NumPy, or PyTorch CPU/CUDA estimators, then benchmarks their accuracy and timings; a separate visualization command reads benchmark JSON and produces comparison, speedup, convergence, and sampling plots. CUDA availability and batched execution are also supported. Benchmark and demo source was not excerpted, so their links to estimator implementations are shown as unverified rather than asserted as direct calls.
Main entry points: benchmark.py Benchmark runner · visualize.py Plot generation · simple_demo.py Simple demo · cpu_methods.py Python and NumPy
Components 8
User entry points
- Simple demo
examples/simple_demo.py
Estimation methods
- Python and NumPy
pi_estimation/cpu_methods.py - PyTorch CPU and CUDA
pi_estimation/gpu_methods.py
Benchmarking
- Benchmark runner
pi_estimation/benchmark.py - Benchmark JSON
Visualization
- Plot generation
pi_estimation/visualize.py - PNG plots
Other components
- User
Connections 8
- User → Simple demo: runs
README.md - User → Benchmark runner: runs
README.md - User → Plot generation: runs
README.md - Benchmark runner → Python and NumPy: uses
- Benchmark runner → PyTorch CPU and CUDA: uses
- Benchmark runner → Benchmark JSON: writes
README.md - Plot generation → Benchmark JSON: reads
README.md - Plot generation → PNG plots: writes
README.md