From faf3c154aa7e3bce120b5333a445f4151be3d462 Mon Sep 17 00:00:00 2001 From: Philipp Emanuel Weidmann Date: Thu, 25 Jun 2026 17:51:04 +0530 Subject: [PATCH] feat: print PyTorch config when running tests --- config.default.toml | 3 +++ src/heretic/config.py | 6 ++++++ src/heretic/main.py | 4 ++++ tests/mistral-3/config.toml | 5 +++-- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/config.default.toml b/config.default.toml index 7ce6a5a..dc9423a 100644 --- a/config.default.toml +++ b/config.default.toml @@ -71,6 +71,9 @@ chain_of_thought_skips = [ # Whether to print prompt/response pairs when counting refusals. print_responses = false +# Whether to print additional information that can help with debugging. +print_debug_information = false + # Whether to print detailed information about residuals and refusal directions. print_residual_geometry = false diff --git a/src/heretic/config.py b/src/heretic/config.py index 17710d0..602075e 100644 --- a/src/heretic/config.py +++ b/src/heretic/config.py @@ -252,6 +252,12 @@ class Settings(BaseSettings): exclude=True, ) + print_debug_information: bool = Field( + default=False, + description="Whether to print additional information that can help with debugging.", + exclude=True, + ) + print_residual_geometry: bool = Field( default=False, description="Whether to print detailed information about residuals and refusal directions.", diff --git a/src/heretic/main.py b/src/heretic/main.py index 89c5754..38bad4a 100644 --- a/src/heretic/main.py +++ b/src/heretic/main.py @@ -268,6 +268,10 @@ def run(): print(get_accelerator_info()) + if settings.print_debug_information: + print() + print(torch.__config__.show().strip()) + # We don't need gradients as we only do inference. torch.set_grad_enabled(False) diff --git a/tests/mistral-3/config.toml b/tests/mistral-3/config.toml index 5600222..bbfb992 100644 --- a/tests/mistral-3/config.toml +++ b/tests/mistral-3/config.toml @@ -1,14 +1,15 @@ model = "tiny-random/mistral-3" model_commit = "931aa2e5c9668fc3679e56aa44972fe18597d55d" +seed = 12345 +print_debug_information = true + batch_size = 2 max_response_length = 10 kl_divergence_target = 0 n_trials = 2 n_startup_trials = 1 -seed = 12345 - export_strategy = "merge" checkpoint_action = "restart" trial_index = 0