Files
agila-learning-examples/en/expanded-30-4/lesson-2/lesson.html
T

4 lines
1.8 KiB
HTML

<!doctype html><html lang="en"><meta charset="utf-8"><title>Select a backend from evidence</title><h1>Select a backend from evidence</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>Filter candidates by capability, correctness, memory capacity, and constraints before comparing speed. Match representative workload sizes and include transfers. Preserve a fallback when a device is absent. The table below contains invented demonstration results, explicitly marked as such; replace them with real measurements only after validation. Do not fit a policy to one lucky run.</p><p><strong>Practice and evidence:</strong> Predict the example or draw its state transitions. Change one assumption, test the boundary, and record the actual result. Explain what this small model does not establish about a production system.</p><pre><code class="language-python">candidates=[{&quot;name&quot;:&quot;CPU demo&quot;,&quot;correct&quot;:True,&quot;ms&quot;:8},{&quot;name&quot;:&quot;GPU demo&quot;,&quot;correct&quot;:True,&quot;ms&quot;:11},{&quot;name&quot;:&quot;Broken demo&quot;,&quot;correct&quot;:False,&quot;ms&quot;:1}]
valid=[c for c in candidates if c[&quot;correct&quot;]]
print(&quot;Hypothetical winner:&quot;,min(valid,key=lambda c:c[&quot;ms&quot;])[&quot;name&quot;])
</code></pre><p><strong>Expected result:</strong> <code>Hypothetical winner: CPU demo</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://git.agilaos.com/matt/open_agx">Language reference: git.agilaos.com</a></p><p><a href="https://docs.nvidia.com/cuda/cuda-c-best-practices-guide/">Language reference: docs.nvidia.com</a></p></html>