Skip to content

Commit

Permalink
Clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
qingqing01 committed May 17, 2022
1 parent a317fad commit f296df1
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 11 deletions.
1 change: 0 additions & 1 deletion examples/language_model/gpt-3/static/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,6 @@ def parse_args(MODEL_CLASSES):
type=int,
default=1,
help="The hyper-parameter in beam search.")

parser.add_argument(
"--save_inference_model_then_exist",
type=bool,
Expand Down
2 changes: 0 additions & 2 deletions examples/language_model/gpt-3/static/modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -999,10 +999,8 @@ def forward(self,
layers.increment(x=step_idx, value=1.0, in_place=True)
layers.array_write(placehold_ids, i=step_idx, array=ids)

######### GPT forward #########
logits, cached_kvs = self.model(
pre_ids, use_cache=True, cache=cached_kvs)
######### GPT forward #########

logits = paddle.reshape(logits, shape=(-1, self.vocab_size))
probs = F.softmax(logits / self.temperature)
Expand Down
8 changes: 0 additions & 8 deletions examples/language_model/gpt-3/static/run_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,6 @@ def do_generation(args):
sharding_degree=args.sharding_degree,
mp_degree=args.mp_degree)

is_first = False
is_last = False
if topo.pp_info.rank == 0:
is_first = True
if topo.pp_info.rank == (topo.pp_info.size - 1):
is_last = True

logger.info("The topo of hybrid parallelism:\n{}".format(topo))

model_class, tokenizer_class = MODEL_CLASSES[args.model_type]
Expand Down Expand Up @@ -208,7 +201,6 @@ def do_generation(args):
ins = {v.name: v for v in feeds}
preds = model(ins)


# Define the Executor for running the static model
exe = paddle.static.Executor(place)
exe.run(startup_program)
Expand Down

0 comments on commit f296df1

Please sign in to comment.