googleapis / googleapis/python-aiplatform

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

Abierto
#1,994 6 comentarios 1 reacción 0 asignados Ver en GitHub
api: vertex-ai
Lenguaje dominante
Python
Estrellas
905
Forks
465
Merge medio
1 d 13 h
PR fusionados (30 d)
44

Descripción

#### 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.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.