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

Add a context concept to the workflow #290

Merged
merged 1 commit into from
Apr 9, 2024
Merged

Add a context concept to the workflow #290

merged 1 commit into from
Apr 9, 2024

Conversation

naddeoa
Copy link
Collaborator

@naddeoa naddeoa commented Apr 9, 2024

This adds a new concept of a "context" and accompanying types for populating that context. Metrics declare which context dependencies they need and the workflow ensures that they're run.

The driver for this now is the lack of visibility into perf. Before this change, metrics that all needed the same embeddings to be computed would avoid wasted work recomputing them indirectly through @cache on the types that generate the embeddings. This meant that the first metric that happened to need the metric ended up looking pretty bad in terms of perf with the rest looking good.

The context formalizes this and avoid the caching by pulling common dependencies out and computing them once for everyone. If multiple metrics declare a dependency on something then those are deduped as well.

This adds a new concept of a "context" and accompanying types for
populating that context. Metrics declare which context dependencies they
need and the workflow ensures that they're run.

The driver for this now is the lack of visibility into perf. Before this
change, metrics that all needed the same embeddings to be computed would
avoid wasted work recomputing them indirectly through @cache on the
types that generate the embeddings. This meant that the first metric
that happened to need the metric ended up looking pretty bad in terms of
perf with the rest looking good.

The context formalizes this and avoid the caching by pulling common
dependencies out and computing them once for everyone. If multiple
metrics declare a dependency on something then those are deduped as
well.
@naddeoa naddeoa merged commit c92793d into workflow Apr 9, 2024
5 checks passed
@naddeoa naddeoa deleted the context branch April 9, 2024 14:50
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.

1 participant