Writing large number of metrics to Google Cloud Storage via Cloud Storage FUSE is very slow
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 38/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- google-cloud, python
- Área
- cloud, performance
Línea de trabajo
Comienza en tensorboard.summary.writer.event_file_writer.EventFileWriter e inspecciona cómo su escritor de archivos genérico gestiona fs_supports_append. Reproduce la comparación con una ruta de Google Cloud Storage FUSE y, después, verifica que escribir muchos eventos evita el retraso demostrado y mantiene el comportamiento normal del sistema de archivos local; el payload no especifica ningún archivo de prueba.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
This can be trivially reproduced given that you have an access to some Google Cloud project in which you have permissions to run Vertex AI custom training jobs and create Google Cloud Storage (GCS) buckets.
- In Vertex AI, submit some fake custom training job (using e.g.
python:3.10Docker image andcommand: ["sleep", "3600"]) with interactive shell enabled (if you're submitting this job via Python's SDK, simply passenable_web_access=TruetoCustomJob's.submit()method). - Once you'd get this job in "Training" state, open two terminals by clicking "Launch web terminal" in its GUI - we will use them for Python and Bash, respectively.
- In GCS, create some bucket of your choice and make sure that you can write to it.
- In the first terminal, run
pip install tensorboardand then launch Python interpreter. - Copy & paste this code to Python's shell, replacing
<NAME_OF_YOUR_BUCKET>with the name of the bucket that you've created in step (3):
from time import time
from tensorboard.compat.proto import event_pb2
from tensorboard.compat.proto.summary_pb2 import Summary
from tensorboard.summary.writer.event_file_writer import EventFileWriter
path = "/gcs/<NAME_OF_YOUR_BUCKET>/"
def get_fake_metric(i):
summary = Summary(value=[Summary.Value(tag=f"val_metric{i}", simple_value=0.123)])
event = event_pb2.Event(summary=summary)
event.wall_time = time()
event.step = 1
return event
- In the second terminal (Bash),
cdto/gcs/<NAME_OF_YOUR_BUCKET>/and make sure that there are no existing event files there. - We will start with the default writer - paste this to Python's shell:
writer = EventFileWriter(path)
- Switch to Bash and run the following (we will be using this to monitor the size of event files - at the beginning you should see one such file having 88 bytes):
while true; do date '+%H:%M:%S'; ls -l | grep event; sleep 1; done
- Switch to Python and run:
for i in range(200): writer.add_event(get_fake_metric(i))
- Switch to Bash and observe how your event file is growing - it should reach slightly above 10 KB. Once it will stop growing, terminate your monitoring loop and note how long it took (for me, it was
2m23s). Delete this file afterwards. - Now, we will repeat this experiment with slightly modified writer. Switch to Python and paste the following:
writer = EventFileWriter(path)
assert writer._general_file_writer.fs_supports_append
writer._general_file_writer.fs_supports_append = False
- Switch to Bash and run the same monitoring loop as in step (8).
- Switch to Python and run the same loop as in step (9), followed by
writer.flush()because otherwise you'd have to wait extra 2 minutes. - Switch to Bash and notice that your event file reached its expected size almost instantly.
Q: What does this experiment show?
A: It shows that EventFileWriter is not aware of Cloud Storage FUSE filesystem, which leads to suboptimal performance (and to make it clear: this monkey-patching of fs_supports_append doesn't mean that this fs doesn't support append - it's just a hack meant to foolEventFileWriter).
Q: But writing events to disk is asynchronous, so even if it is slow, why should we care?
A: Because some training frameworks (e.g. PyTorch Lightning) explicitly flush metrics at the end of the validation loop (which is quite reasonable thing to do, I'd say), and with hundreds of them (600+ in my case), training is stuck for non-negligible time after each validation (7-8 minutes in my case) - and the more frequent the validations, the more badly it accumulates w.r.t. total training time and GPU utilization. And besides, good engineers simply can't stand seeing that writing such relatively small amount of data takes so much time ;)
- Lenguaje dominante
- TypeScript
- Estrellas
- 7.2k
- Forks
- 1.7k
- Merge medio
- 1 d 13 h
- PR fusionados (30 d)
- 3
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de tensorflow/tensorboard
-
node_repositories in WORKSPACE missing linux_ppc64le and linux_s390x entries for Node.js 18.20.8Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
tensorflow/tensorboard#7140 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Error Parsing Hyper Parameters (`HPARAMS`) on WindowsPosiblemente ocupada @Ramnath0521 la tomó hace 4 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
tensorflow/tensorboard#7175 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 10/100
tensorflow/tensorboard#7159 ·
Los mantenedores suelen responder en 1 día
-
installAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 10/100
tensorflow/tensorboard#7158 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
tensorflow/tensorboard#7153 ·
Los mantenedores suelen responder en 1 día
Todos los issues de tensorflow/tensorboard
Issues similares
-
documentation lens:human needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
thebristolsound/birdbrain#2246 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
A voting window past about 69.9 million hours stores a deadline that reads back as no deadlineAbiertobug ready-for-human
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
BoardGamesEmpire/board-games-empire-backend#1452 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
good first issue stretch
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día