Docs / Compute: GPU & CPU

Compute: GPU & CPU

Every cufemlab run travels the same reliable path — API to queue to worker to database to artifacts — and each analysis lands on the processor built for it: GPU-first for the heavy motor field solves, CPU for the estimates, utilities, and 3-D field validation.

The principle. cufemlab puts each analysis on the processor that fits it. Large, uniform, parallel field solves run on a GPU (RTX-class) node where that hardware genuinely wins; estimates, materials work, signed reports, the quick demo, and the 3-D field validation solve run on CPU, where they are already fast and where a GPU would only add overhead. The result is the same either way: a signed result.v1 envelope plus artifacts.

How a run executes

Whether you submit from the web app at /app/ or from the Python SDK, a run moves through one predictable pipeline:

Queue reliability, stated plainly. Jobs are enqueued durably and carry an explicit status through their whole life, so a submission is never silently lost — it is QUEUED, RUNNING, then COMPLETED or FAILED, and you can poll it at /app/queue.html or via job.wait(). We do not claim a formal uptime SLA or exactly-once delivery in this beta; we do claim clean, observable state transitions.

The GPU-first and CPU lanes

The catalog has fifteen live analyses. Nine are GPU-first; six run on CPU. Both lanes produce the identical result.v1 envelope and artifacts — the only difference is which processor does the arithmetic.

GPU-first · RTX-class node

Heavy 2-D motor field solves

Magnetostatic finite-element solves over motor meshes of tens of thousands of unknowns, re-run on every design point. These are exactly the large, uniform, parallel workloads a GPU accelerates, so they run GPU-first.

cogging_torque_movingband — flagship, FEMM/GetDP-validated
cogging_sweep_2d — legacy 2-D sweep, no oracle card
pmsm_operating_torque — engineering estimate
CPU lane

Estimates, utilities & 3-D validation

Steinmetz-type loss estimates, catalog lookups, deterministic report signing, the quick demo, and the 3-D edge-element field solve are already fast on CPU cores — a GPU launch would only add transfer and kernel overhead.

iron_loss_estimate · material_comparison
signed_report_generation · demo_motor_quick_check
cufem3d_field_validation — 3-D, currently CPU

Two analysis types are cross-checked against an external reference: cogging_torque_movingband against the open-source FEMM and GetDP solvers, and cufem3d_field_validation against an analytic sphere. Both cite a tolerance and a measured error. cogging_sweep_2d does not carry an oracle card. cogging_torque_movingband is the flagship validated cogging workflow (2-D moving-band / Arkkio) and cogging_sweep_2d is a legacy, superseded 2-D sweep. pmsm_operating_torque and iron_loss_estimate are engineering estimates, not independently validated. See Motor workflow and Physics domains for the details behind each number.

Submitting a run

The SDK mirrors the pipeline above. Create a project, optionally upload CAD, submit an analysis, wait for the terminal state, then read the result. Requesting a GPU workflow is a flag on the submit call; omit max_minutes to use the per-analysis default budget.

Submit a GPU-first cogging solvePython
import os
from cufemlab_client import Client

client = Client(api_key=os.environ["CUFEMLAB_API_KEY"])   # base url defaults to https://app.cufemlab.secrotec.nl

project = client.create_project(name="stator-rev-C")
# optional: upload CAD (.step / .stp / .iges / .stl)
# f = client.upload_file(project.id, "rotor.step")

job = client.analyze(
    project_id=project.id,
    analysis_type="cogging_torque_movingband",   # GPU-first workflow
    input_params={"poles": 8, "slots": 12},
    gpu=True,                                  # request the RTX-class node
)                                              # max_minutes omitted -> per-analysis default

job.wait(poll_interval=5)                        # QUEUED -> RUNNING -> COMPLETED
r = job.result()
print(r.verdict, r.value, r.summary, r.metrics)   # result.v1 envelope

For signed_report_generation, call job.download_report("report.pdf") on the completed job to retrieve the deterministic, HMAC-signed PDF (SHA-256 provenance). Full call surface: API reference; more end-to-end scripts: Examples.

The result envelope and artifacts

Every completed job — GPU or CPU lane — returns the same versioned result.v1 envelope, so your client code does not branch on where the work ran:

Alongside the envelope, artifacts persist as downloadable files: field and flux data as .vtu, torque waveforms, the per-run validation card, and signed report PDFs. Manage them from /app/reports.html.

Per-user concurrency cap

Each account has a per-user concurrency cap — the number of jobs it may have running at once — which keeps shared GPU capacity fair and queue latency predictable. Submitting a job beyond that cap is rejected cleanly:

HTTP 429 · CONCURRENCY_LIMIT_EXCEEDED. A submission over your concurrency cap returns HTTP 429 with error code CONCURRENCY_LIMIT_EXCEEDED. The extra request is refused, not silently dropped and not queued behind the cap — so your client can back off and retry once a running job finishes. Watch live capacity at /app/queue.html.

Billing is fail-closed

Admission is gated on credits before any compute starts. If the account does not have the credits an analysis requires — or if credit state cannot be confirmed — the job is refused rather than run for free. This is a deliberate fail-closed default.

No live card billing in this beta. Online payment (Stripe) is not activated; credits are provisioned through your pilot. Any checkout mock you may encounter is not a real charge — never treat it as one. Track your balance at /app/credits.html.

The 3-D field validation lane

cufem3d_field_validation is cufemlab's live 3-D lane: a 3-D magnetostatic edge-element (Nédélec) solve that produces geometry, mesh, and the magnetic field and flux as .vtu, and returns a relative-error field verdict. It is the geometry-and-field validation lane on the path toward full 3-D motor simulation. It runs on CPU today, is free-trial eligible at 1 credit, and completes in ≤ 5 minutes. Full walkthrough: cufem3d.

Available today

  • API → Redis queue → worker → Postgres → artifacts pipeline
  • GPU-first 2-D motor field solves (GPU-first)
  • CPU lane for estimates, materials, signed reports, demo (CPU)
  • 3-D field & flux validation with a relative-error verdict
  • Per-user concurrency cap and durable job status

Maturing

  • 3-D field validation lane (currently CPU); broader field/flux coverage
  • Wider parameter sweeps and batch submission ergonomics
  • Deeper roadmap toward full 3-D motor simulation

Roadmap / not claimed

  • Full 3-D motor torque with skew and end-effects
  • Full 3-D operating maps and a full thermal solver
  • Transient / time-harmonic eddy-current and conductive-region multiphysics
  • Any speed or accuracy claim versus a commercial tool (none benchmarked)

3-D field validation is available now; full 3-D motor torque — with skew and end-effects — is on the roadmap. For the complete honest boundary, see Hard limitations and Roadmap.

Start a run →   Read the API reference →