Skip to content

Commit 809afe2

Browse files
committed
chore: resolve ci linting issues.
1 parent c10103b commit 809afe2

File tree

4 files changed

+5
-16
lines changed

4 files changed

+5
-16
lines changed

grail/infrastructure/checkpoint_consumer.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,6 @@ def _write_cached_checkpoint(
510510
metadata: CheckpointMetadata,
511511
) -> None:
512512
"""Write cached checkpoint synchronously (called from thread)."""
513-
import torch
514513
from safetensors.torch import save_file
515514

516515
tmp_dir = output_dir.parent / f"{output_dir.name}.partial"
@@ -1016,7 +1015,6 @@ async def _apply_delta_chain(
10161015
Path to reconstructed checkpoint directory, or None on failure
10171016
"""
10181017
import torch
1019-
from safetensors.torch import save_file
10201018

10211019
try:
10221020
# Load anchor weights

grail/neurons/miner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ async def _run() -> None:
247247
timers,
248248
monitor,
249249
self.use_drand,
250-
checkpoint_window,
250+
current_checkpoint_window,
251251
)
252252

253253
if inferences:

grail/trainer/checkpoint_publisher.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -277,26 +277,19 @@ async def _compute_keep_windows(
277277

278278
# Fetch anchor_window for each retained delta (the FULL checkpoint it depends on)
279279
anchor_windows = await asyncio.gather(
280-
*(
281-
_fetch_delta_anchor_window(delta_window, credentials)
282-
for delta_window in deltas_to_keep
283-
)
280+
*(_fetch_delta_anchor_window(delta_window, credentials) for delta_window in deltas_to_keep)
284281
)
285282
for delta_window, anchor_window in zip(deltas_to_keep, anchor_windows, strict=False):
286283
if anchor_window is not None:
287284
keep.add(int(anchor_window))
288-
logger.debug(
289-
"Keeping anchor %d (required by delta %d)", anchor_window, delta_window
290-
)
285+
logger.debug("Keeping anchor %d (required by delta %d)", anchor_window, delta_window)
291286
continue
292287

293288
# Fallback: keep nearest FULL checkpoint before this delta
294289
for full_window in full_windows:
295290
if full_window < delta_window:
296291
keep.add(full_window)
297-
logger.debug(
298-
"Keeping fallback anchor %d for delta %d", full_window, delta_window
299-
)
292+
logger.debug("Keeping fallback anchor %d for delta %d", full_window, delta_window)
300293
break
301294

302295
logger.info(

tests/unit/infrastructure/test_chained_deltas.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99

1010
from __future__ import annotations
1111

12-
from unittest.mock import AsyncMock, MagicMock, patch
12+
from unittest.mock import MagicMock, patch
1313

14-
import pytest
1514
import torch
1615

1716
from grail.infrastructure.checkpoint_consumer import CheckpointMetadata
@@ -21,7 +20,6 @@
2120
compute_weights_hash,
2221
)
2322

24-
2523
# ============================================================================
2624
# Tests for Chained Delta Precision (bit-exact bf16 reconstruction)
2725
# ============================================================================

0 commit comments

Comments
 (0)