0Pricing
Mojo Academy · Lesson

Locking In the Best Config

Specialize on the chosen parameters.

Locking In the Best Config is a free Mojo Academy lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Mojo Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

From Search to Setting

Once the search names a winner, you commit to it. Locking in means specializing your kernel on that exact configuration for real use.

Bake In the Values

Set the winning numbers as compile-time aliases so the compiler builds one optimized version instead of searching again at runtime.

alias best_tile = 32
alias best_width = 8

Specialize the Kernel

Call your kernel with the chosen parameters in the brackets. From now on it runs as that single, fully specialized variant.

kernel[best_tile, best_width]()

No Runtime Search

The tuned program does zero searching while it runs. All that work happened at compile time, so each execution is pure fast kernel.

Verify Correctness Again

Confirm the specialized version still produces the right answers. A faster kernel is worthless if tuning changed its output.

Confirm the Speedup

Re-time the locked-in build against the baseline to prove the gain is real. The measured speedup is your evidence the tuning paid off.

Tie Config to Hardware

The best values belong to the machine they were found on. Note the hardware so nobody assumes the same numbers win everywhere.

Retune on New Targets

Moving to a different CPU or GPU? Run the search again there. Same source, fresh tuning, best settings for that target.

Keep a Tuning Record

Store the chosen values and the workload they were tuned on. A clear record makes results reproducible and easy to revisit.

Beware Overfitting

Tune on inputs that match production. Settings tuned to a toy workload can disappoint on the real sizes your app actually handles.

The Full Loop

Expose knobs, search, then lock in the winner: that cycle turns one generic kernel into a machine-specific peak performer. 🏁

Quick Check

Pin down what locking in the best config means.

Recap

You baked the winning values in as aliases, verified correctness and the speedup, recorded the hardware, and learned to retune on new targets. 🎯

Frequently asked questions

Is the “Locking In the Best Config” lesson free?

Yes — the full text of “Locking In the Best Config” is free to read here on the web, and the Mojo Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Mojo Academy course, upgrade to CoddyKit PRO.

What will I learn in “Locking In the Best Config”?

Specialize on the chosen parameters. You practise Mojo Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Mojo Academy?

No prior experience is required. Mojo Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Locking In the Best Config” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Mojo Academy lesson?

Yes. Every Mojo Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. What Autotuning Solves
  2. Parameterizing Tile and Width
  3. Searching the Parameter Space
  4. Locking In the Best Config
← Back to Mojo Academy