You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why: Safetensors screws up the order of the layers because it stores the layers in sort order by name
To fix this, the code internally reads a layer_map
ipytorch_model.bin.index.json
Before any filters are applied, the code first iterates over all the layers (i.e. over all safetensors files) to see which layers are skipped.
Then, a second pass is applied, (I think) the filters are already applied
So in the case above, the first layer_id is not 286, it is 0
I think what happes Proposed Solutions: WWLayerIterator.apply_filters() only checks ww_layer.layer_id and ww_layer.name against the filter_ids,
Don't check ww_layer.layer_id against filter_ids directly. Instead
loop up the key in the layer map, and check the layer against the ww_layer.name. The names are usually unique for safetensors, but not in general
change the current layer_id to the correctlayer_id , but I'm not sure how yet since there a re 2 passes over the iterator
only apply the filters if layer_map is none...so it is is only applied on the first pass
hack like 3, but skip all filters if layer_map is not None and layer_map['source']==SAFETENSORS
for debugging, don't use layerids, use names for safetensors. THIS DOES NOT WORK EITHER
Note sure if any of these will work since the Test_Albert_DeltaLayerIterator unit test does work and breaks some of the tests..but not all...with 3:
Problem: The following fails when using models & base_models in the safetensors format
Why: Safetensors screws up the order of the layers because it stores the layers in sort order by name
To fix this, the code internally reads a layer_map
ipytorch_model.bin.index.json
Before any filters are applied, the code first iterates over all the layers (i.e. over all safetensors files) to see which layers are skipped.
Then, a second pass is applied, (I think) the filters are already applied
So in the case above, the first layer_id is not 286, it is 0
I think what happes
Proposed Solutions:
WWLayerIterator.apply_filters()
only checksww_layer.layer_id
andww_layer.name
against the filter_ids,Don't check
ww_layer.layer_id
againstfilter_ids
directly. Insteadlayer_id
to the correctlayer_id
, but I'm not sure how yet since there a re 2 passes over the iteratorif layer_map is not None and layer_map['source']==SAFETENSORS
Note sure if any of these will work since the
Test_Albert_DeltaLayerIterator
unit test does work and breaks some of the tests..but not all...with 3:THESE TESTS FAIL
adding now...does not work yet
it ONLY works with 3. !!!
Modifying the layer_map could be bad since we might iterate over it
It may be better to set the source in the iterator
The text was updated successfully, but these errors were encountered: