googleapis / googleapis/python-aiplatform

Importing class `Model` from `google.cloud.aiplatform.models` is slow

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

描述

#### Environment details

- OS type and version:
- Python version: 3.8
- pip version: 20.1.1
- `google-cloud-aiplatform` version: `google-cloud-aiplatform>=1.7.1,<2.0.0`

#### Steps to reproduce

1. Create a Python file in an environment where `google-cloud-aiplatform` is installed
2. Type: `from google.cloud.aiplatform.models import Model`
3. Run it with `time python`

#### Code example

```python
from google.cloud.aiplatform.models import Model
```

#### Stack trace
```
real 0m0.836s
user 0m1.085s
sys 0m1.045s
```

Compare it with an import of an entire package such as `pandas` (`import pandas as pd`):
```
real 0m0.271s
user 0m0.541s
sys 0m0.930s
```

I originally opened this issue in [Apache Airflow](https://github.com/apache/airflow/discussions/29615) repository, and I was referred to here. The time of import makes parsing of Airflow DAGs that utilize Vertex AI operators significantly slower.

贡献指南

打开贡献指南

调研方向

未指定源文件或测试。使用所述的 Python 和软件包版本,重现 `from google.cloud.aiplatform.models import Model` 的导入耗时,将其与 pandas 基线进行比较,并追踪哪些导入占主导地位;在不更改公共导入路径的情况下减少报告的导入开销,即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
machine-learning, performance
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

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