Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow resource release at the end of life of the LitAPI object #420

Open
Alexandre-SCHOEPP opened this issue Feb 3, 2025 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@Alexandre-SCHOEPP
Copy link


🚀 Feature

We have a setup method, which allows one to initialize for each worker the resources needed for inference.

I want the exact reverse: When the server closes, to release the resource (via an abstract teardown method or similar)

Motivation

Some APIs need more than just temporary state (DB connection, prompt files, etc...). Not being able to release them forces one to use garbage collection to release the data, which is an unsafe way to proceed.

Pitch

sequenceDiagram
    participant MAIN as parent process
    create participant WORKER as worker process
    MAIN ->> WORKER: fork()
    WORKER ->> WORKER: setup
    note over MAIN, WORKER: server lifetime
    WORKER ->> WORKER: teardown
    destroy WORKER
    WORKER ->> MAIN: child process is dead
    MAIN ->> MAIN: program finalization
Loading
@Alexandre-SCHOEPP Alexandre-SCHOEPP added the enhancement New feature or request label Feb 3, 2025
@aniketmaurya
Copy link
Collaborator

great point @Alexandre-SCHOEPP! would you be interested in adding a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants