Port a tiny scaled-dot-product attention to Modal (GPU-resourced)
Background
The file /app/original.py contains the reference Python workflow.
The reference implements one-head scaled dot-product attention over a small sequence: softmax(Q K^T / sqrt(d)) V. Input arrays Q, K, V all have shape (B, T, D). The function returns the attention output and the attention weight matrix.
Each case is a dict with "Q_list", "K_list", "V_list" (nested float lists) and run_case must return {"out": <(B,T,D) nested-list>, "weights": <(B,T,T) nested-list>}.
Your task
Port the workflow to Modal and save the result as /app/solution/modal_app.py.
The file must define a module-level Modal app and a module-level run_case entrypoint. The verifier invokes run_case once per case dictionary, and the returned value must match the reference output within numerical tolerance.
Capability contract
Expose the workflow as a single Modal remote function: define run_case as an @app.function so the harness can invoke it with run_case.remote(case).