This workflow constructs a symmetric n x n matrix on CPU by symmetrizing a random matrix, transfers it to GPU, computes torch.linalg.eigh, and reconstructs the matrix as Q diag(λ) Q^T. It returns the number of eigenvalues, the reconstruction error, the sum of eigenvalues, and the smallest eigenvalue. The case dict has keys n and seed.
See /app/workspace/solution.py for the reference implementation.
Your task
Port this workflow to Modal. The eigendecomposition should run on a GPU.
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).
The solution must also use:
GPU.
Required output file
/app/solution/modal_app.py
Required interface
Define a module-level app and a module-level entrypoint named run_case.
The entrypoint returns a dict with keys: