Kmonte/tb inferencer examples#624
Draft
kmontemayor2-sc wants to merge 6 commits intomainfrom
Draft
Conversation
Adds two optional fields on ``VertexAiResourceConfig`` for opting into Vertex AI TensorBoard. ``tensorboard_resource_name`` points at an existing ``Tensorboard`` resource; ``tensorboard_experiment_name`` is the user-chosen ``TensorboardExperiment`` ID under that resource — multiple jobs sharing this name surface as comparable runs on the same TB page. The fields must be set together (or both unset). The validation rule is not enforced yet (lands in a follow-up PR); this commit only adds the proto fields and regenerates Python + Scala stubs. Also expands the docstring on ``TrainedModelMetadata.tensorboard_logs_uri`` to document its mapping to ``AIP_TENSORBOARD_LOG_DIR`` via ``CustomJobSpec.baseOutputDirectory``. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds the launcher-side TensorBoard plumbing. After this PR, callers that pass ``tensorboard_logs_uri`` get ``baseOutputDirectory`` set on the CustomJob, and resource configs that set ``tensorboard_experiment_name`` get three env vars injected into the worker container so the trainer's chief-rank uploader can find the named experiment. - ``_build_job_config`` accepts ``tensorboard_logs_uri: Optional[Uri]`` and derives ``base_output_dir`` from it. - When the resource config sets ``tensorboard_experiment_name``, inject ``GIGL_TENSORBOARD_RESOURCE_NAME``, ``GIGL_TENSORBOARD_EXPERIMENT_NAME``, and ``GIGL_TENSORBOARD_RUN_NAME`` (sanitized + UTC-suffixed for per-launch uniqueness). - ``_maybe_log_tensorboard_url`` prints the cross-job TB experiment URL at submit time so the link is visible in the launcher's local stdout. - ``VertexAiJobConfig`` gains a ``base_output_dir`` field, threaded through to ``aiplatform.CustomJob``. - ``get_tensorboard_logs_gcs_path`` now returns ``<asset_dir>/logs/`` (was ``<asset_dir>/tensorboard_logs/``), aligning with Vertex AI's ``<base_output_dir>/logs/`` convention so writer events land where ``AIP_TENSORBOARD_LOG_DIR`` points. Updates the ConfigPopulator unit test that asserts on the path suffix. Reading the new fields off the resource config and the ``tensorboard_logs_uri`` off the GbmlConfig is deferred to the next PR (trainer/inferencer dispatch) — production trainers don't pass ``tensorboard_logs_uri`` yet, so this change is invisible to existing production runs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Reads ``TrainedModelMetadata.tensorboard_logs_uri`` from the GbmlConfig and threads it into ``launch_single_pool_job`` / ``launch_graph_store_enabled_job`` from both ``GLTTrainer`` and ``GLTInferencer``. After this PR, the launcher (PR 3) actually receives the GCS path on real training and inference jobs, which means ``baseOutputDirectory`` gets set on the CustomJob and ``AIP_TENSORBOARD_LOG_DIR`` is populated inside the worker container. The chief-rank uploader / writer (next PR) is what reads those env vars and starts streaming events. Sharing ``tensorboard_logs_uri`` across trainer and inferencer is deliberate: Vertex's ``baseOutputDirectory`` is component-agnostic, and the launcher injects a different ``GIGL_TENSORBOARD_RUN_NAME`` per job (``gigl_train_<task>`` vs ``gigl_infer_<task>``), so the two surface as separate runs in the same ``TensorboardExperiment``. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds chief-rank TensorBoard event emission to the four example trainer
entry points (homogeneous + heterogeneous, single-pool + graph-store).
Each trainer now:
- constructs ``tensorboard_writer = TensorBoardWriter.from_env(enabled=is_chief_process)``
- calls ``tensorboard_writer.log({...}, step=batch_idx)`` for train,
val, and test loss curves
- closes the writer at the end (paired uploader shutdown)
Updates the example resource configs with both
``tensorboard_resource_name`` and ``tensorboard_experiment_name``
(populated with the placeholder ``user-provided-experiment-name`` —
valid under the Vertex AI Experiment ID regex enforced by validation).
The CORA task config gains a comment pointing at the new proto field.
The README adds a TensorBoard section documenting the two fields and
the URL-in-stdout flow.
The writer files (``gigl/utils/tensorboard_writer.py`` +
``tests/unit/utils/tensorboard_writer_test.py``) ride along since this
PR depends on them; they're owned by the writer PR and will collapse
out of this diff once that PR merges.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds chief-rank TensorBoard event emission to the four example inferencer entry points (homogeneous + heterogeneous, single-pool + graph-store). Each inferencer now logs ``Inference/throughput_batches_per_sec`` on the chief rank. Updates the example resource configs to set ``tensorboard_resource_name`` + ``tensorboard_experiment_name`` on the inferencer-side resource configs (single-pool ``vertex_ai_inferencer_config`` and graph-store ``compute_pool``). Without these, the launcher would not inject ``GIGL_TENSORBOARD_*`` env vars on inferencer jobs and the writer would no-op. Inferencer runs share the experiment with trainer runs but get a distinct ``TensorboardRun`` (sanitized from ``gigl_infer_<task>`` vs ``gigl_train_<task>``), so they appear as separate runs on the same TensorBoard page. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Wires the OSS project's Vertex AI TensorBoard resource into both ``e2e_glt_resource_config.yaml`` and ``e2e_glt_gs_resource_config.yaml`` so that the link_prediction examples (single-pool and graph-store) emit events on every run. - TB resource: ``projects/87123883529/locations/us-central1/tensorboards/2426122984222621696`` - Experiment: ``gigl-oss-examples`` (shared across all OSS example runs; each job appears as a distinct ``TensorboardRun``). Set on the trainer-side ``vertex_ai_trainer_config`` and the inferencer-side ``vertex_ai_inferencer_config`` for the single-pool config, and on the ``compute_pool`` of both ``vertex_ai_graph_store_trainer_config`` and ``vertex_ai_graph_store_inferencer_config`` for the graph-store config. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
/all_test |
Contributor
GiGL Automation@ 22:53:49UTC : 🔄 @ 24:31:25UTC : ❌ Workflow failed. |
Contributor
GiGL Automation@ 22:53:52UTC : 🔄 @ 22:57:22UTC : ✅ Workflow completed successfully. |
Contributor
GiGL Automation@ 22:53:56UTC : 🔄 @ 23:02:59UTC : ✅ Workflow completed successfully. |
Contributor
GiGL Automation@ 22:53:56UTC : 🔄 @ 23:59:26UTC : ✅ Workflow completed successfully. |
Contributor
GiGL Automation@ 22:53:58UTC : 🔄 @ 22:59:48UTC : ❌ Workflow failed. |
Contributor
GiGL Automation@ 22:54:01UTC : 🔄 @ 23:55:13UTC : ✅ Workflow completed successfully. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scope of work done
Where is the documentation for this feature?: N/A
Did you add automated tests or write a test plan?
Updated Changelog.md? NO
Ready for code review?: NO