aws / aws/sagemaker-python-sdk

Create Awaitable predict capability

Abierto
#3,973 10 comentarios 5 reacciones 0 asignados Ver en GitHub
component: async inference type: feature request
Lenguaje dominante
Python
Estrellas
2.3k
Forks
1.3k
Merge medio
1 d 22 h
PR fusionados (30 d)
35

Descripción

**Describe the feature you'd like**
Like many other inference libraries in python (e.g. OpenAI), create a real awaitable version of Predict for realtime sagemaker inference endpoints. This will help python applications that use FastAPI and asyncio to deliver realtime responses while not blocking the main event loop. Please note that this feature is different that the one currently available [here](https://sagemaker.readthedocs.io/en/v2.169.0/api/inference/predictor_async.html) where the predictions are written to a S3 bucket. This feature would work exactly like https://sagemaker.readthedocs.io/en/stable/api/inference/predictors.html#sagemaker.predictor.Predictor.predict but with an `await` in real `asyncio` style.

Sagemaker is an amazing library and it would be just way better for production environments using FastAPI to have this feature.

**How would this feature be used? Please describe.**
In this case, currently, the sync version looks like this:
```python
response = predictor.predict(input_data)
```
The async might be looking like
```python
response = await predictor.apredict(input_data)
```

**Describe alternatives you've considered**
I considered subclassing the `predictor` and add the async version.

**Additional context**
For modern python applications building on top of FastAPI and Asyncio, it is crucial to use async modalities do avoid blocking the main event-loop in the server (in case of scalable applications). Therefore, having a real `awaitable` functionality would avoid blocking the main event loop of the applications that leverage sagemaker.

Thanks alot

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza con el comportamiento documentado de Predictor.predict y compáralo con la capacidad predictor_async existente vinculada en el issue, que escribe las predicciones en S3. Traza cómo se realizan las llamadas a los endpoints de SageMaker en tiempo real y determina la interfaz necesaria para un equivalente awaitable. Se considera terminado cuando las aplicaciones de Python asyncio pueden hacer await de predicciones en tiempo real sin usar comportamiento asíncrono respaldado por S3 ni bloquear el bucle de eventos.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
aws, python
Área
cloud, machine-learning
Tipo de issue
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.