Commit eebe1c2 1 parent 71c9359 commit eebe1c2 Copy full SHA for eebe1c2
File tree 3 files changed +9
-2
lines changed
src/plugins/intel_npu/src/plugin/npuw
3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -632,7 +632,7 @@ void ov::npuw::CompiledModel::CompiledModelDesc::deserialize(std::istream& strea
632
632
633
633
// Also read weights into LazyTensors
634
634
for (std::size_t cidx = 0 ; cidx < closure.size (); ++cidx) {
635
- if (closure_uid[cidx] != -1 ) { // previously registered before serialization
635
+ if (closure_uid[cidx] != -1 && lazy_closure[cidx] ) { // previously registered before serialization
636
636
lazy_closure[cidx].read_weight (weights);
637
637
}
638
638
}
Original file line number Diff line number Diff line change @@ -175,7 +175,9 @@ struct Unpack {
175
175
}
176
176
void read_weight (const ov::npuw::s11n::Weights& weights) {
177
177
w.read_weight (weights);
178
- z.read_weight (weights);
178
+ if (z) { // could be empty
179
+ z.read_weight (weights);
180
+ }
179
181
s.read_weight (weights);
180
182
}
181
183
void detach () {
@@ -472,6 +474,10 @@ void LazyTensor::read_weight(const ov::npuw::s11n::Weights& weights) {
472
474
m_impl->read_weight (weights);
473
475
}
474
476
477
+ LazyTensor::operator bool () const {
478
+ return m_impl != nullptr ;
479
+ }
480
+
475
481
std::size_t LazyTensor::get_hash () const {
476
482
if (!m_impl) {
477
483
return 0 ;
Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ class LazyTensor {
48
48
void serialize (std::ostream& stream) const ;
49
49
static LazyTensor deserialize (std::istream& stream);
50
50
void read_weight (const ov::npuw::s11n::Weights& weights);
51
+ operator bool () const ;
51
52
52
53
private:
53
54
std::shared_ptr<LazyTensorImpl> m_impl = nullptr ;
You can’t perform that action at this time.
0 commit comments