googleapis / googleapis/python-aiplatform

batch_predict sync=False should create a job even if the shell exits

未关闭
#2,072 5 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
api: vertex-ai type: feature request
主要语言
Python
星标
905
派生
465
平均合并
1 天 13 小时
30 天内合并 PR
44

描述

#### Environment details

- OS type and version: Google Composer (composer-2.1.7-airflow-2.4.3)
- Python version: 3.8.12
- pip version: 20.2.4
- `google-cloud-aiplatform` version: 1.16.1 (within composer-2.1.7-airflow-2.4.3)

#### Steps to reproduce

1. Run `aip.Model(model_name)..batch_predict(..., sync=False)` from your code
2. Exit the program/shell right after you issue this call.
3. The last lines you will see in the output before exiting:

![Screenshot 2023-04-07 at 9 37 16 AM](https://user-images.githubusercontent.com/2609368/230618244-d6de1491-b925-4ab2-97c4-222da76656b6.png)

4. If you go to the VertexAI console, you will see no indication that a batch predict request was even submitted/aborted. It's like it never happened.
5. Looking at the logs for VertexAI, we do see `The operation was cancelled`.

![Screenshot 2023-04-07 at 9 00 46 AM](https://user-images.githubusercontent.com/2609368/230619673-a28184eb-9dc9-45da-9429-f66ab7f9085b.jpg)

This sort of makes sense as the background execution/monitoring thread was terminated. However, it is surprising that there is no indication in the VertexAI console a batch prediction request was ever made.

#### Stack trace

N/A, silent failure

#### Expectation

I would expect `sync=False`, apart from giving me the ability to do something else in my program, to be truly async and have at least guaranteed the batch predict job is created/running.

A [similar issue](https://github.com/googleapis/python-aiplatform/issues/688) was opened and fixed for Jobs in general. In that case, `submit` was made available in addition to the regular `run`.

It would be great if sticking around was optional for `sync=False`. I do believe that is more in line with the semantics as well.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。