Skip to content

fix(integ): update debugger/profiler for opt-in defaults - #6189

Open
nargokul wants to merge 4 commits into
aws:master-v2from
nargokul:fix-integ-tests-debugger-profiler-opt-in
Open

fix(integ): update debugger/profiler for opt-in defaults#6189
nargokul wants to merge 4 commits into
aws:master-v2from
nargokul:fix-integ-tests-debugger-profiler-opt-in

Conversation

@nargokul

@nargokul nargokul commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Builds on / continues #6188, which makes DebuggerHookConfig and an active ProfilerConfig opt-in instead of attached by default. The integ suite for #6188 failed because several tests (and one source path) still assumed the old default-on behavior.

This PR fixes those 5 integ-test failures. Because #6188 is not yet merged into master-v2, this branch includes #6188's two commits plus the fixes here, so the changes are coherent on their own.

Failing tests fixed

  • test_debugger.py::test_debug_hook_disabled_with_checkpointing
  • test_profiler.py::test_mxnet_with_default_profiler_config_and_profiler_rule
  • test_profiler.py::test_mxnet_profiling_with_disable_debugger_hook
  • test_profiler.py::test_mxnet_with_built_in_profiler_rule_with_custom_parameters
  • sagemaker/workflow/test_training_steps.py::test_training_job_with_debugger_and_profiler

Changes

Source (src/sagemaker/estimator.py)

  • In _prepare_profiler_for_training, auto-attach a ProfilerConfig when a ProfilerRule is passed, mirroring the existing debugger-rule handling. Without this, passing a profiler rule emitted a ProfilerRuleConfiguration alongside ProfilerConfig: {"DisableProfiler": True} — an invalid request shape (a profiler rule with profiling disabled). Passing a ProfilerRule is itself an opt-in, so it now gets a config to attach to.

Tests

  • test_debugger.py: added debugger_hook_config=True to the PyTorch, TensorFlow, and XGBoost checkpointing blocks. Debugger is now opt-in, so a hook must exist for the "checkpointing + distributed disables the hook" logic to act on. The block asserting the hook survives (XGBoost) and the blocks asserting it is force-disabled to False (PyTorch/TF) both need an explicit opt-in now.
  • test_profiler.py (2 tests): request profiling explicitly via profiler_config=ProfilerConfig(system_monitor_interval_millis=500). The disable_debugger_hook test keeps ProfilingStatus == "Enabled" so it still proves that turning off the debug hook does not turn off profiling.
  • test_training_steps.py: request profiling explicitly in the debugger+profiler pipeline test (plus the ProfilerConfig import).

Testing

All 5 tests were run for real against AWS in us-west-2 (Python 3.10, matching CI's py310) — the profiler and workflow tests launched actual training jobs / a pipeline execution:

Test Result
test_debug_hook_disabled_with_checkpointing ✅ passed
test_mxnet_with_default_profiler_config_and_profiler_rule ✅ passed
test_mxnet_profiling_with_disable_debugger_hook ✅ passed
test_mxnet_with_built_in_profiler_rule_with_custom_parameters ✅ passed
test_training_job_with_debugger_and_profiler ✅ passed

zhaoqizqwang and others added 3 commits August 17, 2026 14:49
PR aws#6188 makes DebuggerHookConfig and active ProfilerConfig opt-in rather
than attached by default. Update the integ tests that assumed the old
default-on behavior, and fix one source gap:

- estimator.py: auto-attach a ProfilerConfig when a ProfilerRule is passed,
  mirroring the existing debugger-rule handling. Without this, a profiler
  rule was emitted alongside DisableProfiler=True (an invalid request shape).
- test_debugger.py: pass debugger_hook_config=True in the PyTorch/TensorFlow/
  XGBoost checkpointing blocks so the force-disable logic has a hook to act on.
- test_profiler.py: request profiling explicitly via profiler_config in the
  two tests that relied on the default-on profiler.
- test_training_steps.py: request profiling explicitly in the debugger+profiler
  pipeline test.
@nargokul
nargokul requested a review from a team as a code owner August 18, 2026 18:44
@nargokul
nargokul requested a review from mujtaba1747 August 18, 2026 18:44
@nargokul
nargokul deployed to auto-approve August 18, 2026 19:09 — with GitHub Actions Active
CreateTrainingJob rejects the request with:

  ValidationException: "ProfilerRuleConfigurations" cannot be provided
  without "ProfilerConfig".

Two unit tests asserted a populated profiler_rule_configs alongside
profiler_config={"DisableProfiler": True}, a shape the service will not
accept. Verified against the real SageMaker API in us-west-2. Update both
to expect the ProfilerConfig that is now attached when a ProfilerRule is
passed.
@nargokul
nargokul force-pushed the fix-integ-tests-debugger-profiler-opt-in branch from d0c24ca to 6cea507 Compare August 18, 2026 21:14
@nargokul nargokul changed the title fix(integ): update debugger/profiler integ tests for opt-in defaults fix(integ): update debugger/profiler for opt-in defaults Aug 18, 2026
@nargokul
nargokul deployed to auto-approve August 18, 2026 21:40 — with GitHub Actions Active
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants