aws / aws/sagemaker-python-sdk
Create Awaitable predict capability
- 主要言語
- Python
- スター
- 2.3k
- フォーク
- 1.3k
- 平均マージ
- 1日 22時間
- マージ済み PR(30日)
- 35
説明
**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
コントリビューションガイド
調査の方向性
文書化されている Predictor.predict の動作から始め、Issue でリンクされている既存の predictor_async 機能と比較してください。この機能は予測を S3 に書き込みます。リアルタイムの SageMaker エンドポイント呼び出しがどのように行われているかを追跡し、await 可能な同等機能に必要なインターフェースを特定してください。完了の定義は、Python asyncio アプリケーションが S3 ベースの非同期動作を使用したりイベントループをブロックしたりせずに、リアルタイム予測を await できることです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- aws, python
- 領域
- cloud, machine-learning
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100