HistoryEncoder interface is incomplete, so callers isinstance-check AttentionHistory #35
Notifications
Due Date
No due date set.
Blocks
Reference: lars/giant#35
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Stage2Autoregressive.init_history_cacheand.history_step(
giant/model/models.py:419-440) both branch onisinstance(self.history_encoder, AttentionHistory). The base class(
giant/model/history.py:8-22) declares onlyforward, and its docstringexplains that
init_cache/stepare conditionally-implemented extras.So a third history type must be known to
Stage2Autoregressiveto work,which is the definition of a non-pluggable plug point.
historyis alsovalidated as a two-value enum in three separate places (
config.py:1276,models.py:320, and thefrom_dictdefault).Proposal: move
init_cache/stepontoHistoryEncoderwith the O(1)defaults
MarkovHistoryalready satisfies (init_cache → None,step(f, h, c) → (self(f, h), c)), addHISTORY_REGISTRY+register_history,and delete both
isinstancechecks. Validation then becomes "is it in theregistry", in one place.
Payoff:
history = "gru","mean_prefix", or"none"(a real ablation:does the AR decoder's history earn its parameters?) each become a single
registered class. Small, self-contained, no checkpoint impact — good first
issue.
Migrated from
issues.md(v0.3.0 branch review, 2026-08-13), Issue 10.