Skip to content

Add performance analysis report for Python/GPU implementation#1

Draft
Copilot wants to merge 1 commit into
mainfrom
copilot/analyse-performance-implmentation-python-gpu
Draft

Add performance analysis report for Python/GPU implementation#1
Copilot wants to merge 1 commit into
mainfrom
copilot/analyse-performance-implmentation-python-gpu

Conversation

Copy link
Copy Markdown

Copilot AI commented May 6, 2026

Adds analyse_problemes_performance.md, a detailed French-language technical report analysing why this Python/Numba+PyTorch implementation is significantly slower than Google's original mobile ISP pipeline.

Report covers

  • 12 identified bottlenecks with precise file/line references, including:

    • Numba JIT cold-start (10–60s per fresh process)
    • 80+ cuda.synchronize() barriers per burst from PyTorch/Numba framework mixing (alignment.py:107)
    • Redundant CPU→GPU transfer + full FFT2D pipeline for greyscale conversion on every comparison frame (super_resolution.py:144)
    • Monte Carlo noise curve recomputed on every process() call (super_resolution.py:254)
    • Logic bug + race condition in L1 block matching (block_matching.py:167, identical in 32/64 variants)
    • O(N²) bubble sort inside a CUDA kernel (utils_image.py:303)
    • GPU thread occupancy capped at ~25% (DEFAULT_THREADS=16)
  • Prioritised fix recommendations: quick wins (cache, constant kernel hoisting, thread config), medium-term (stream overlap, single-backend migration, AOT compilation), and structural refactors

  • Estimated impact: quick wins + medium-term optimisations projected to bring a 12MP×20-frame burst from ~4s to <1.5s on RTX 3090, plus eliminating JIT cold-start entirely

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants