@@ -102,9 +102,6 @@ void CustomFusedLoraOperation::ClearInternal() {
102102 aclWeightA_.clear ();
103103 aclWeightB_.clear ();
104104 aclWeightATranspose_.clear ();
105- weightA_.clear ();
106- weightB_.clear ();
107- weightATranspose_.clear ();
108105
109106 aclScalingInput_.clear ();
110107 scalingInput_.clear ();
@@ -115,19 +112,6 @@ void CustomFusedLoraOperation::ClearInternal() {
115112 aclScalingExecutor_.clear ();
116113}
117114
118- // Helper function to create weight tensor
119- atb::Tensor CustomFusedLoraOperation::CreateWeightTensor (const atb::Tensor& baseTensor, int64_t rank, int64_t dim, uint64_t offset) {
120- atb::Tensor weightTensor;
121- weightTensor.desc .dtype = baseTensor.desc .dtype ;
122- weightTensor.desc .format = baseTensor.desc .format ;
123- weightTensor.desc .shape .dimNum = baseTensor.desc .shape .dimNum ;
124- weightTensor.desc .shape .dims [0 ] = rank;
125- weightTensor.desc .shape .dims [1 ] = dim;
126- weightTensor.dataSize = atb::Utils::GetTensorSize (weightTensor.desc );
127- weightTensor.deviceData = static_cast <uint8_t *>(baseTensor.deviceData ) + offset;
128- return weightTensor;
129- }
130-
131115// Helper function to calculate offset for weight tensors
132116uint64_t CustomFusedLoraOperation::CalculateWeightOffset (const std::vector<int32_t >& ranksVec, size_t adapterId, uint64_t tensorSizePerRank) {
133117 uint64_t offset = 0 ;
@@ -183,12 +167,6 @@ int CustomFusedLoraOperation::Setup(const atb::VariantPack& variantPack, uint64_
183167 const int64_t loraBDim = variantPack.inTensors .at (2 ).desc .shape .dims [1 ];
184168
185169 ClearInternal ();
186-
187- // Pre-allocate vectors to avoid reallocations
188- weightA_.reserve (adapterIdsVec.size ());
189- weightATranspose_.reserve (adapterIdsVec.size ());
190- weightB_.reserve (adapterIdsVec.size ());
191-
192170 aclWeightA_.reserve (adapterIdsVec.size ());
193171 aclWeightB_.reserve (adapterIdsVec.size ());
194172 aclWeightATranspose_.reserve (adapterIdsVec.size ());
0 commit comments