Support additional fanout logging to Snowflake Experiments - #31
Open
sfc-gh-yuzhao wants to merge 13 commits into
Open
sfc-gh-yuzhao wants to merge 13 commits into
sfc-gh-yuzhao wants to merge 13 commits into
Conversation
Replace the direct tinker_cookbook ml_log dependency with a unified setup_logging() factory in recipes/utils.py. When sf_experiment is set, metrics and parameters are logged to Snowflake's native experiment tracking instead of Weights & Biases. The SnowflakeExperimentLogger class exposes the same log_metrics/close interface so training loops are unchanged. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add _CompositeLogger to fan out log_metrics/close to multiple backends when both sf_experiment and wandb_project are set. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… docs Testing revealed two issues: - _create_snowpark_session was missing the user field, causing auth failures - Doc examples used hyphens in experiment names which are invalid SQL identifiers Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Pass user field inline instead of conditional append - Drop unnecessary _ prefix filter in _log_config_params - List user in doc prerequisites Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
KeyError from missing host/pat is clear enough; Snowpark session creation also fails with its own error on bad config. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
|
thanks for doing that.
|
Address PR feedback: - Add create_snowpark_session() to CortexTrainingClient so recipes reuse the client's PAT credentials instead of separate login code - Pass experiment_name into the job body via running_job() so the experiment is tied to the Cortex Training job - Retrieve server-assigned run name via get_experiment_run(job_id) - Remove sf_run_name config field (server owns run naming) - Delete _create_snowpark_session() and setup_logging() factory Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
DRY up _open_experiment_artifact_connection and create_snowpark_session by factoring credential resolution into _snowflake_connection_kwargs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove sf_experiment config field and sf_tracking conditional — every training run now logs to Snowflake automatically. The server assigns experiment/run names per job, so no user configuration is needed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
|
Also, could we update the README at recipe folder level about snowflake experiment tracking integration, it's easier for people to figure out there |
sfc-gh-srajbhandari
left a comment
There was a problem hiding this comment.
Lets not force SF logging. Please make it optional. Lot of folks are going to want to use wandb.
SF experiment logging is now opt-in via sf_tracking=True. The logger no longer calls end_run on close — the server manages run lifecycle. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move Snowflake experiment tracking classes and setup out of utils.py into a new logging module. Consolidate the two-step ml_log + SF setup into a single setup_logging(config, client, job_id) call. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
|
could we also update |
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.
Summary
Changes
Usage
W&B still works alongside — set wandb_project and sf_tracking=True together for both.
Test plan