Skip to content

Fix _drop_timestamp being called as an instance method - #88

Open
magic-peach wants to merge 1 commit into
llm-d:mainfrom
magic-peach:fix/drop-timestamp-instance-call
Open

Fix _drop_timestamp being called as an instance method#88
magic-peach wants to merge 1 commit into
llm-d:mainfrom
magic-peach:fix/drop-timestamp-instance-call

Conversation

@magic-peach

Copy link
Copy Markdown

What does this PR do?

_drop_timestamp is defined at module scope but was called as self._drop_timestamp(...) at four call sites (metrics calculation, TTFT training, TPOT training, and ensemble training) in training/training_server.py. This PR calls the module-level function directly at all four sites and removes the @staticmethod decorator on _drop_timestamp, since it has no effect on a module-level function.

Why is this change needed?

Each of the four call sites raised AttributeError: 'LatencyPredictor' object has no attribute '_drop_timestamp'. The error was caught by a broad except block, so the service kept running and reporting ready, but train() silently no-opped: the current model was never replaced and predictions stayed at the cold-start default of approximately 10.0 for both TTFT and TPOT.

How was this tested?

  • Unit tests added/updated
  • Integration/e2e tests added/updated
  • Manual testing performed

Added tests/test_training_server.py, which calls _calculate_metrics_on_test with minimal synthetic data and asserts no error is logged. Verified locally that this test fails against the pre-fix code (it catches the AttributeError being logged) and passes with the fix. Also ran ruff check on both changed files with no findings.

Checklist

  • Commits are signed off (git commit -s) per DCO
  • Code follows project contributing guidelines
  • Tests pass locally (make test)
  • Linters pass (make lint)
  • Documentation updated (if applicable)

Related Issues

Fixes #80

_drop_timestamp is a module-level function but was called as
self._drop_timestamp at four call sites in metrics calculation, TTFT
training, TPOT training, and ensemble training. Each raised an
AttributeError that got swallowed by a broad except block, so
training silently no-opped and predictions stayed stuck at the
cold-start default. Call the function directly and drop the
staticmethod decorator, which has no effect outside a class.

Signed-off-by: Akanksha Trehun <akankshatrehun@gmail.com>
@magic-peach
magic-peach requested a review from ahg-g as a code owner September 6, 2026 14:11
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.

[Bug]: Training fails because _drop_timestamp is called as an instance method

1 participant