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

Split up /call and /logs. #1152

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

rohinb2
Copy link
Contributor

@rohinb2 rohinb2 commented Aug 14, 2024

No description provided.

Copy link

sentry-io bot commented Aug 14, 2024

🔍 Existing Issues For Review

Your pull request is modifying functions with the following pre-existing issues:

📄 File: runhouse/servers/http/http_client.py

Function Unhandled Issue
call_module_method AttributeError: 'FluxPipelineExample' object has no attribute 'pipeline' ...
Event Count: 6
call_module_method ValueError: Cannot instantiate this tokenizer from a slow version. If it's based on sentencepiece, make sure ... ...
Event Count: 5
call_module_method ModuleNotFoundError: No module named 'torch' call...
Event Count: 3
call_module_method OutOfMemoryError: CUDA out of memory. Tried to allocate 54.00 MiB. GPU 0 has a total capacity of 22.19 GiB of which... ...
Event Count: 3

Did you find this useful? React with a 👍 or 👎

@@ -68,6 +71,9 @@

app = FastAPI(docs_url=None, redoc_url=None)

# TODO: Better way to store this than a global here?
running_futures: Dict[str, Future] = {}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if it's really any better, but could store it in the FastAPI app state, since this is only useful for the life of the server anyway right?

@@ -461,6 +462,32 @@ async def get_call(
serialization=serialization,
)

# `/logs` POST endpoint that takes in request and LogParams
@staticmethod
@app.get("/logs/{run_name}/{serialization}")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what serialization options are relevant for logs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the event of exception we still need to serialize with the expected type

@@ -68,6 +71,9 @@

app = FastAPI(docs_url=None, redoc_url=None)

# TODO: Better way to store this than a global here?
running_futures: Dict[str, Future] = {}
Copy link
Collaborator

@jlewitt1 jlewitt1 Aug 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small nit - isn't this technically storing a Task object

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, good point

result = handle_response(
resp, output_type, error_str, log_formatter=self.log_formatter
with ThreadPoolExecutor() as executor:
# Run logs request in separate thread. Can start it before because it'll wait 5 seconds for the
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe i missed this but where are is the delay for the calls request to begin?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no delay for that... in the /logs endpoint server side, there's a delay where it waits for the call to start.

@rohinb2 rohinb2 force-pushed the 08-14-Make_thread_coroutine_more_generally_usable branch from fe8cb72 to 9bee76b Compare August 15, 2024 20:45
@rohinb2 rohinb2 force-pushed the 08-14-Split_up_/call_and_/logs_ branch from 7cb3b41 to 6d77b0e Compare August 15, 2024 20:45
@rohinb2 rohinb2 force-pushed the 08-14-Make_thread_coroutine_more_generally_usable branch from 9bee76b to 6b66f66 Compare August 16, 2024 18:41
@rohinb2 rohinb2 force-pushed the 08-14-Split_up_/call_and_/logs_ branch from 6d77b0e to 8a9a1aa Compare August 16, 2024 18:41
@rohinb2 rohinb2 force-pushed the 08-14-Make_thread_coroutine_more_generally_usable branch from 6b66f66 to 04232f8 Compare August 16, 2024 21:08
@rohinb2 rohinb2 force-pushed the 08-14-Split_up_/call_and_/logs_ branch from 8a9a1aa to d0decb7 Compare August 16, 2024 21:09
@rohinb2 rohinb2 force-pushed the 08-14-Make_thread_coroutine_more_generally_usable branch from 04232f8 to 1a4b9ca Compare August 19, 2024 14:34
@rohinb2 rohinb2 force-pushed the 08-14-Split_up_/call_and_/logs_ branch from d0decb7 to 3e892d6 Compare August 19, 2024 14:34
@rohinb2 rohinb2 changed the base branch from 08-14-Make_thread_coroutine_more_generally_usable to graphite-base/1152 August 20, 2024 14:29
@rohinb2 rohinb2 force-pushed the 08-14-Split_up_/call_and_/logs_ branch from 3e892d6 to 47fa18b Compare August 20, 2024 14:32
@rohinb2 rohinb2 changed the base branch from graphite-base/1152 to main August 20, 2024 14:32
@rohinb2 rohinb2 force-pushed the 08-14-Split_up_/call_and_/logs_ branch 9 times, most recently from f2d9f49 to 80cb59e Compare August 21, 2024 22:45
@rohinb2 rohinb2 force-pushed the 08-14-Split_up_/call_and_/logs_ branch from ec4ac45 to d43439a Compare September 17, 2024 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants