Changelog¶
Notable API and core changes only. This project follows semantic versioning.
[0.2.0] - 23. September 2026¶
Changed¶
These can require edits to code written for 0.1.
align_inputsreturns a 1-Dint64column index, not a tensor. Index your data with it:X[:, col].Hopstores packedsource_index/target_indexinstead of a mask, soPackedLinearnow works on hops. CallHop.to_mask()for the dense mask.Skip.source_index/target_indexare renamed tosource_in_layer/target_in_layer.MaskedLinear.weightis a plain parameter (state_dictkeyweight, wasparametrizations.weight.original); readeffective_weight()for the masked map. 0.1 checkpoints still load.MaskedLinear,PackedLinear, andPackedMultiheadAttentionignoretorch.autocastand compute in their parameter dtype.PackedLinear.forwardraisesKpnn2Errorwhen the input's last dimension is notin_features.
Added¶
PackedMultiheadAttention: attention restricted to the prior's edges, with optionalchunk_sizeto bound memory.aggregate_node_attributionsandlist_aggregation_methods: fold named node scores with a registered method. The default method,rauter_mangano_2026, is not yet implemented.PackedLinear.transpose()andscatter_hop_outputs, for tied decoders.widths=on both parsers, so a node can own several units, andranks=onparse_layered, to set depths yourself.constraint=onMaskedLinearandPackedLinear(for example positive or frozen edges), witheffective_weight()andinit_bound().identity=on all three layers: a spec fingerprint stored in the checkpoint and checked on load.generator=on all three layers, for isolated parameter init.edge_location()andnode_units()on both specs, andhop_units()onLayeredSpec: find a named edge's weight slots or a node's units.hop_input=,hop_output=, andaxis="inputs"onmap_node_attributions: say which side of a hop, or which input units, a tensor holds.
Fixed¶
map_node_attributionsno longer shares memory with the input tensor, and it accepts bfloat16 scores (stored as float32).
Dependencies¶
xarray>=2024.11, with no upper bound.
[0.1.0] - 1. September 2026¶
First release of kpnn2.