Skip to content

[Feature] GPU (CUDA) inference as a cuda extra #164

Open

Description

@b-re-w

The engine runs on CPU; Windows and Linux install CPU torch wheels (#139). Add a cuda extra (CUDA torch wheels) and a device option so the engine can run on an NVIDIA GPU (SPEC S1.11; PROJECT §7 M4).

Done when: uv sync --extra cuda installs CUDA torch and the engine runs on cuda with the same tests passing on a GPU runner.

Activity

  1. b-re-w commented on Nov 21, 2026

    @b-re-w
    MemberAuthor

    Moved out of Gemstone 1.0 (after 1.0): no GPU runner is available to meet the criterion. Criterion unchanged. Source: team leader answer, 2026-11-21 18:00 (owner goal 2026-11-21: ship a stable 1.0 of every project).

  2. b-re-w commented on Nov 21, 2026

    @b-re-w
    MemberAuthor

    Back in Gemstone 1.0; my earlier after-1.0 comment is withdrawn. Criterion unchanged. Source: owner, 2026-11-21 21:55 via the team leader ("일을 제대로 하면 될거를 쓸데없이 자꾸 미루려고만 하네? 191, 443, 175 전부 1.0에 넣어"; every after-1.0 move the leader approved is withdrawn).

  3. b-re-w commented on Nov 21, 2026

    @b-re-w
    MemberAuthor

    Criterion changed by the owner (2026-11-21 23:00 via the team leader: "그건 내가 테스트 해줄테니까 ci로 안할거야"): the owner's manual CUDA run passes; CI keeps the device-free tests (api/tests/test_serving_options.py).

    Implementation: PR #254 (GEMSTONE_DEVICE, the cuda extra with torch 2.15.0+cu132, /api/ps size_vram). Once #254 is on develop, on a machine with an NVIDIA GPU (driver for CUDA 13.2, i.e. R580 or newer):

    git clone https://github.com/LogitAI/Gemstone.git && cd Gemstone   # or git pull on develop
    uv sync --locked --python 3.13 --extra cuda
    uv run --extra cuda python -c "import torch; print(torch.__version__, torch.cuda.is_available(), torch.cuda.get_device_name(0))"
    GEMSTONE_TEST_DEVICE=cuda uv run --extra cuda pytest -m real_model -v      # the real-model tests on the GPU (downloads SmolLM2-135M once)
    GEMSTONE_DEVICE=cuda uv run --extra cuda python -m api run server          # then chat once from the app or:
    curl http://127.0.0.1:23100/api/chat -d '{"model":"qwen3","messages":[{"role":"user","content":"Hi"}],"stream":false}'
    curl http://127.0.0.1:23100/api/ps        # size_vram equals size while the model is on the GPU

    Passing means: the second line prints True, pytest shows no failures, the chat answers, and /api/ps shows size_vram > 0. Please paste the pytest summary line here; that closes this issue.

  4. b-re-w commented on Nov 21, 2026

    @b-re-w
    MemberAuthor

    Correction to the pytest line above: the tests read only the local Hugging Face cache, so on a fresh machine run it as GEMSTONE_TEST_ALLOW_DOWNLOAD=1 GEMSTONE_TEST_DEVICE=cuda uv run --extra cuda pytest -m real_model -v.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions