Fix _drop_timestamp being called as an instance method - #88
Open
magic-peach wants to merge 1 commit into
Open
Conversation
_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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
_drop_timestampis defined at module scope but was called asself._drop_timestamp(...)at four call sites (metrics calculation, TTFT training, TPOT training, and ensemble training) intraining/training_server.py. This PR calls the module-level function directly at all four sites and removes the@staticmethoddecorator 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, buttrain()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?
Added
tests/test_training_server.py, which calls_calculate_metrics_on_testwith minimal synthetic data and asserts no error is logged. Verified locally that this test fails against the pre-fix code (it catches theAttributeErrorbeing logged) and passes with the fix. Also ranruff checkon both changed files with no findings.Checklist
git commit -s) per DCOmake test)make lint)Related Issues
Fixes #80