Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-40823: Explore methods for calculating Prompt Processing preload timing #107

Merged
merged 9 commits into from
Feb 1, 2024

Conversation

kfindeisen
Copy link
Member

@kfindeisen kfindeisen commented Dec 8, 2023

This PR adds two timing frameworks to Prompt Processing. The first, based on the logger, is flexible and easy to modify, but makes it hard to track long-term changes. The second, based on a hybrid of lsst.verify and analysis_tools, allows upload of timing metrics to Sasquatch, but individual metrics must be added and removed with care.

ups/prompt_processing.table Show resolved Hide resolved
python/activator/timer.py Show resolved Hide resolved
tests/test_timer.py Outdated Show resolved Hide resolved
python/activator/timer.py Outdated Show resolved Hide resolved
This log helps clarify when the Flask app is ready to take requests.
The timer uses time_this instead of logInfo because raw timestamps are
almost impossible to work with in Loki (in particular, they can't be
parsed into something that allows arithmetic operations).
Timing of export_outputs, clean_local_repo, make_quantum_graph, and
_filter_calibs_by_date should pin down the remaining I/O bottlenecks.
This context manager allows streamlined timing of arbitrary code
blocks, placing the results in a MetricMeasurementBundle for upload to
Sasquatch.
In light of Sasquatch's strict compatibility requirements, the metrics
are limited to three times that will almost certainly survive future
implementation changes: TotalTime (the running time of prep_butler,
excluding the timing infrastructure itself), SearchTime (the time to
identify the datasets to import), and TransferTime (the time to
actually update the local repo's state).
The enforce_schema function allows the removal of timing metrics in the
future without breaking Sasquatch rules. It's unlikely that this
function will ever be ported to analysis_tools, as it's a workaround
for the absence of a coherent timing action.
Configuring a dispatcher directly lets us sidestep the problem of using
the Butler, and also gives us full control over the metadata associated
with the upload.
Authentication is not yet supported server-side, but defining an
environment variable will let us support it through the usual
secrets mechanisms.
@kfindeisen kfindeisen merged commit 0829e12 into main Feb 1, 2024
5 checks passed
@kfindeisen kfindeisen deleted the tickets/DM-40823 branch February 1, 2024 01:44
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