FullColor FFT profiling

A source checkout contains a resumable driver, tools/fft_profiling/fft_profiling.py, that compares exact full-color matrix-element implementations. It delegates generation, profiling, validation, plotting and PDF assembly to the existing developer tools; the driver owns only selection, scheduling, per-cell resource guards and persistent progress. It is meant for a workstation or a cluster node with explicit CPU, memory and wall-time budgets.

Three things share the word FFT:

  • symmetric-group FFT contraction is pyAmpliCol’s algorithm for exact NLC and full color in recurrence and on-the-fly execution, selected in an ordinary artifact with color.contraction (--color-contraction, --fft adjoint or --fft trace); Color explains it to users;
  • Reference FFT is the optional external AllGluonsMultipletFFT checkout used for comparison;
  • the profiling driver described here measures both, beside direct pyAmpliCol, original AmpliCol and MadGraph where they apply.

When you read the curves, compare the saved fft_basis_selection of each artifact as well as the request: requesting the adjoint basis does not imply that every process used it or gained a smaller basis. Curves keep the basis settings they were measured with. Compare setup and warmed runtime separately for each workload.

Prepare a profiling checkout

Enter the repository’s Nix environment when available, then request only the optional references needed by the scan:

nix develop
just dev-install --with-reference-fft --with-legacy-amplicol

--with-reference-fft clones the public rikkert-frederix/AllGluonsMultipletFFT revision pinned by pyAmpliCol. --with-legacy-amplicol clones the pinned original-AmpliCol comparison. Both are omitted by a default just dev-install; either opt-in also installs the PDF/plotting dependencies into .venv. If a managed Reference FFT checkout predates the public repository, add --update once so its origin is migrated.

MadGraph is not installed by dev-install. Pass a complete installation root containing bin/mg5_aMC and VERSION with --madgraph-root.

Select process families and curves

The scan has two independent process families:

Selector Process family
gg g g > g g + gluons
ddbar d d~ > d d~ + gluons

--lines accepts grouped comparison series:

Selector Curves requested
reference-fft External pure-gluon Reference FFT
amplicol Original AmpliCol
pyamplicol-recurrence pyAmpliCol recurrence direct and FFT
pyamplicol-otf pyAmpliCol on-the-fly direct and FFT
madgraph Same-host MadGraph standalone

For a targeted top-up, use a concrete pyAmpliCol line: recurrence-direct, recurrence-fft, otf-direct, or otf-fft. Required authority/baseline shards are added automatically. For example, a pyAmpliCol pure-gluon comparison may require Reference FFT, while a ddbar comparison may require original AmpliCol.

Small Reference FFT example

This fills only Reference FFT for the pure-gluon family at final-state multiplicities 2, 3, and 4:

.venv/bin/python tools/fft_profiling/fft_profiling.py \
  --output /path/to/fft-reference-gg \
  --families gg --lines reference-fft \
  --multiplicities 2 3 4 \
  --cores 10 \
  --memory-limit-gib 100 --time-limit-seconds 36000 \
  --reference-fft-root "$PWD/dependencies/checkouts/reference-fft"

Use --dry-run first to print the deterministic plan without creating the output or starting workers.

Complete cluster scan

The following command requests both process families, every grouped series, ten scheduler cores, a 100 GiB per-child memory guard, and a 10-hour per-cell time limit in one explicit output directory:

.venv/bin/python tools/fft_profiling/fft_profiling.py \
  --output /path/to/pyamplicol-fft-profile \
  --families gg ddbar \
  --lines reference-fft amplicol pyamplicol-recurrence pyamplicol-otf madgraph \
  --multiplicities 2 3 4 5 6 7 8 9 \
  --cores 10 --candidate-cores 1 \
  --memory-limit-gib 100 --time-limit-seconds 36000 \
  --amplicol-root "$PWD/dependencies/checkouts/legacy-amplicol" \
  --reference-fft-root "$PWD/dependencies/checkouts/reference-fft" \
  --madgraph-root /path/to/MG5_aMC \
  --build-amplicol

--build-amplicol permits the first fixed-helicity AmpliCol shard to build its probe. It can remain on subsequent resumptions; an already valid probe is reused.

The resource options mean exactly this:

  • --cores is the total scheduler slot budget across active children;
  • --candidate-cores is one pyAmpliCol child’s slot claim and exact evaluator.optimization.cores setting;
  • --memory-limit-gib and --time-limit-seconds are strict per-child/per-cell limits, not aggregate campaign limits;
  • the time limit covers generation/setup and runtime measurement;
  • --target-seconds controls calibrated runtime sampling after setup and is not the cell cutoff;
  • --otf-max-multiplicity (default 6) is the largest final-state multiplicity admitted for the on-the-fly curves.

The progress headline reports the active cell, aggregate live RSS, and occupied core slots. A child crossing its own guard is terminated and retained as a cutoff result; other cells continue.

Fixed helicity and complete helicity sums

The default workload evaluates one shared known-nonzero helicity from artifacts that retain general helicity coverage. Add --compare-helicity-sums for the independent complete physical-helicity sum:

.venv/bin/python tools/fft_profiling/fft_profiling.py \
  --output /path/to/pyamplicol-fft-profile-helicity-sum \
  --compare-helicity-sums \
  --families gg ddbar \
  --lines reference-fft amplicol pyamplicol-recurrence pyamplicol-otf madgraph \
  --multiplicities 2 3 4 5 6 \
  --cores 10 --candidate-cores 1 \
  --memory-limit-gib 100 --time-limit-seconds 36000 \
  --amplicol-root "$PWD/dependencies/checkouts/legacy-amplicol" \
  --reference-fft-root "$PWD/dependencies/checkouts/reference-fft" \
  --madgraph-root /path/to/MG5_aMC

Fixed-helicity and helicity-sum measurements have different workload identities and must use separate output directories. MadGraph’s summed lane uses its generated SMATRIX(P,ANS) entry point with USERHEL=-1; it does not reuse fixed-helicity measurements.

Resume, retry, overwrite, or refresh

The default behavior is resumable and additive. Repeating a command with the same --output:

  • recovers unfinished prior requests;
  • skips completed cells;
  • adds newly selected families, lines, and multiplicities to the persistent history;
  • refreshes plots as new completed evidence becomes available.

--resume is an explicit alias for that default. More forceful choices are scoped to the current --families, --lines, and --multiplicities:

Option Effect
--retry Rerun selected failed or skipped cells.
--overwrite Rerun every selected cell; keep its old result until that worker actually starts.
--refresh Delete the exact recognized output workspace and restart it from scratch.

Use targeted overwrite to refine a measured subset without discarding the rest of the campaign:

.venv/bin/python tools/fft_profiling/fft_profiling.py \
  --output /path/to/pyamplicol-fft-profile \
  --families ddbar --lines otf-fft \
  --multiplicities 6 --overwrite \
  --cores 10 --memory-limit-gib 100 --time-limit-seconds 36000

--refresh is conservative: it refuses an unrecognized path and does not remove a workspace while a coordinated MadGraph writer is active.

Inspect machine-readable progress without launching work:

.venv/bin/python tools/fft_profiling/fft_profiling.py \
  --status --output /path/to/pyamplicol-fft-profile

Render what is currently available

The driver publishes immutable snapshots during a scan. Rendering freezes the latest already-published snapshot immediately and never waits for active workers:

.venv/bin/python tools/fft_profiling/fft_profiling.py \
  --render --output /path/to/pyamplicol-fft-profile

For a custom output, the saved manifest determines whether the workload is fixed-helicity or helicity-summed; repeating --compare-helicity-sums is not required. The current PDF is written below:

RUN/render/current/summary_plots_final.pdf
RUN/render/current/summary_plots_final_helicity_sum.pdf

Only the filename matching the run’s workload is produced. The same render contains six PNGs: setup time, warmed runtime, and peak RSS for each process family.

Without a custom output, name the canonical workspace by its workload:

.venv/bin/python tools/fft_profiling/fft_profiling.py --render
.venv/bin/python tools/fft_profiling/fft_profiling.py \
  --render --compare-helicity-sums

Generation selectors (--lines) decide what work enters the campaign. The render-only --main-include-lines, --main-veto-lines, --ratio-include-lines, and --ratio-veto-lines options only control which retained series appear in the main and ratio panels.

Interpret setup and warmed runtime

The plotted setup time is method-specific:

  • pyAmpliCol includes artifact generation, fresh load, first requested evaluation, and OTF family construction where applicable;
  • Reference FFT includes its build, initialization, and first pass;
  • AmpliCol includes its process/color-object or raw-library preparation for the selected workload.

Warmed runtime is measured separately after those setup boundaries. The exact symmetric-group FFT is not guaranteed to beat direct contraction for every process: small certified permutation subgroups or large direct residuals can produce similar scaling.

Rendered PDFs are measurement-host results rather than release-CI benchmarks and are not kept in the repository. Raw campaign workspaces remain local.

See also