Skip to content

Commit f3a9e81

Browse files
committed
clean up pretty_print
1 parent 9444207 commit f3a9e81

File tree

5 files changed

+0
-58
lines changed

5 files changed

+0
-58
lines changed

src/layers/embedding.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ class EmbeddingImpl : public Module {
3333
return F::embedding(input, weight_);
3434
}
3535

36-
void pretty_print(std::ostream& stream) const override {
37-
stream << name() << " " << weight_.sizes() << " " << weight_.device();
38-
}
39-
4036
// return the weight (for testing)
4137
torch::Tensor weight() const { return weight_; }
4238

@@ -84,10 +80,6 @@ class ParallelEmbeddingImpl : public Module {
8480
return output;
8581
}
8682

87-
void pretty_print(std::ostream& stream) const override {
88-
stream << name() << " " << weight_.sizes() << " " << weight_.device();
89-
}
90-
9183
// return the weight (for testing)
9284
torch::Tensor weight() const { return weight_; }
9385

@@ -147,10 +139,6 @@ class VocabParallelEmbeddingImpl : public Module {
147139
return reduce_from_model_parallel_region(output, parallel_args_);
148140
}
149141

150-
void pretty_print(std::ostream& stream) const override {
151-
stream << name() << " " << weight_.sizes() << " " << weight_.device();
152-
}
153-
154142
// return the weight (for testing)
155143
torch::Tensor weight() const { return weight_; }
156144

src/layers/linear_impl.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@ class ColumnParallelLinearImpl : public ParallelLinearImpl {
4242
<< "bias is not loaded for " << prefix + "bias";
4343
}
4444

45-
void pretty_print(std::ostream& stream) const override {
46-
stream << name() << " " << weight_.sizes() << " " << weight_.device();
47-
}
48-
4945
// return the weight (for testing)
5046
torch::Tensor weight() const { return weight_; }
5147

@@ -95,10 +91,6 @@ class RowParallelLinearImpl : public ParallelLinearImpl {
9591
<< "bias is not loaded for " << prefix + "bias";
9692
}
9793

98-
void pretty_print(std::ostream& stream) const override {
99-
stream << name() << " " << weight_.sizes() << " " << weight_.device();
100-
}
101-
10294
// return the weight (for testing)
10395
torch::Tensor weight() const { return weight_; }
10496

src/layers/normalization.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,6 @@ class LayerNormImpl : public Module {
9494
input, normalized_shape_, weight_, bias_, eps_);
9595
}
9696

97-
void pretty_print(std::ostream& stream) const override {
98-
stream << name() << " " << weight_.sizes() << " " << weight_.device();
99-
}
100-
10197
private:
10298
// parameter members, must be registered
10399
torch::Tensor weight_{nullptr};
@@ -131,10 +127,6 @@ class RMSNormImpl : public Module {
131127
return detail::rms_norm(input, weight_, eps_);
132128
}
133129

134-
void pretty_print(std::ostream& stream) const override {
135-
stream << name() << " " << weight_.sizes() << " " << weight_.device();
136-
}
137-
138130
private:
139131
// parameter members, must be registered
140132
torch::Tensor weight_{nullptr};
@@ -163,10 +155,6 @@ class GemmaRMSNormImpl : public Module {
163155
return detail::gemma_rms_norm(input, weight_, eps_);
164156
}
165157

166-
void pretty_print(std::ostream& stream) const override {
167-
stream << name() << " " << weight_.sizes() << " " << weight_.device();
168-
}
169-
170158
private:
171159
// parameter members, must be registered
172160
torch::Tensor weight_{nullptr};
@@ -208,10 +196,6 @@ class RMSNormResidualImpl : public Module {
208196
return detail::rms_norm(input, weight_, eps_);
209197
}
210198

211-
void pretty_print(std::ostream& stream) const override {
212-
stream << name() << " " << weight_.sizes() << " " << weight_.device();
213-
}
214-
215199
private:
216200
// parameter members, must be registered
217201
torch::Tensor weight_{nullptr};

src/quantization/qlinear_gptq_marlin_impl.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@ class ColumnParallelQLinearGPTQMarlinImpl : public ParallelLinearImpl {
3535
void load_state_dict(const StateDict& state_dict,
3636
const std::vector<std::string>& prefixes) override;
3737

38-
void pretty_print(std::ostream& stream) const override {
39-
stream << name() << " qweight=" << qweight_.sizes()
40-
<< " scales=" << scales_.sizes() << " device=" << qweight_.device();
41-
}
42-
4338
private:
4439
// parameter members, must be registered
4540
DEFINE_FUSED_WEIGHT(qweight);
@@ -91,11 +86,6 @@ class RowParallelQLinearGPTQMarlinImpl : public ParallelLinearImpl {
9186
// whether the weight is loaded
9287
void verify_loaded_weights(const std::string& prefix = "") const override;
9388

94-
void pretty_print(std::ostream& stream) const override {
95-
stream << name() << " qweight=" << qweight_.sizes()
96-
<< " scales=" << scales_.sizes() << " device=" << qweight_.device();
97-
}
98-
9989
private:
10090
// parameter members, must be registered
10191
DEFINE_WEIGHT(qweight);

src/quantization/qlinear_impl.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,6 @@ class ColumnParallelQLinearImpl : public ParallelLinearImpl {
7676
void load_state_dict(const StateDict& state_dict,
7777
const std::vector<std::string>& prefixes) override;
7878

79-
void pretty_print(std::ostream& stream) const override {
80-
stream << name() << " qweight=" << qweight_.sizes()
81-
<< " qzeros=" << qzeros_.sizes() << " scales=" << scales_.sizes()
82-
<< " device=" << qweight_.device();
83-
}
84-
8579
private:
8680
// parameter members, must be registered
8781
DEFINE_FUSED_WEIGHT(qweight);
@@ -148,12 +142,6 @@ class RowParallelQLinearImpl : public ParallelLinearImpl {
148142
// whether the weight is loaded
149143
void verify_loaded_weights(const std::string& prefix = "") const override;
150144

151-
void pretty_print(std::ostream& stream) const override {
152-
stream << name() << " qweight=" << qweight_.sizes()
153-
<< " qzeros=" << qzeros_.sizes() << " scales=" << scales_.sizes()
154-
<< " device=" << qweight_.device();
155-
}
156-
157145
private:
158146
// parameter members, must be registered
159147
DEFINE_WEIGHT(qweight);

0 commit comments

Comments
 (0)