You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Training job logs can be significantly long, and are sometimes (but not always) useful to surface when waiting on a job. _TrainingJob.wait() supports the logs parameter to give users control over this.
EstimatorBase.attach() calls .wait(), but doesn't accept and pass through a logs parameter: Meaning users are stuck with log pollution and potential performance degradation.
Describe the solution you'd like .attach() should support and pass through kwargs for .wait(), with same default behaviours as the underlying .wait().
Describe alternatives you've considered
Could hard-wire attach() to a different log status e.g. wait(logs="None") on the basis that after a training job has been completed, we don't need to re-present its logs... But this is an assumption that might be incompatible with other workflows.
There's currently only one argument for wait() - the subject of this request... But in general attach() makes multiple SageMaker API calls with potentially many arguments - so attach() arguments should probably be explicitly defined and fed through, rather than relying on **kwargs.
Additional context
Example use case: Lambda function in a Step Functions pipeline to deploy a model from a known good training job name, via the SageMaker SDK, without polluting the Lambda logs.
Additionally, it looks like simply passing logs=False through to .wait() won't be enough to silence the messages, because _flush_log_streams() is still getting called (and spitting out messages with print() rather than logger).
Thanks for the feature request. We're actually thinking about going a step further, and separating out the logs from attach() entirely. Something like:
estimator.attach("job-name")
estimator.logs()
# another scenarioestimator.fit(wait=False)
estimator.logs()
where logs() could take in other parameters to allow for better control over what logs are printed. (A further extension could include a method that prints out only new log lines, mimicking tail -f.)
Activity
athewsey commentedon Apr 13, 2020
Additionally, it looks like simply passing
logs=Falsethrough to.wait()won't be enough to silence the messages, because_flush_log_streams()is still getting called (and spitting out messages withprint()rather than logger).laurenyu commentedon May 7, 2020
Thanks for the feature request. We're actually thinking about going a step further, and separating out the logs from
attach()entirely. Something like:where
logs()could take in other parameters to allow for better control over what logs are printed. (A further extension could include a method that prints out only new log lines, mimickingtail -f.)athewsey commentedon Nov 19, 2020
Confirming the v2 separation seems to have satisfied the original request - thanks all!
fix: Address SA feedback regarding deployment straight to Endpoint Mo…
fix: Address SA feedback regarding deployment straight to Endpoint Mo…
fix: Address SA feedback regarding deployment straight to Endpoint Mo…