p-doom/crowd-code-dataset-0.2 huggingface dataset:
[content] miles/backends/fsdp_utils/actor.py (python)
ess_rollout_data(self.args, rd, self.dp_rank, self.dp_size)
                for k, v in rd_processed.items():
                    if k not in rollout_data:
                        rollout_data[k] = [v]
                    else:
                        rollout_data[k].append(v)
[content] miles/backends/fsdp_utils/actor.py (python)
rollout_data["advantages"] = rollout_data["returns"] = [
                torch.tensor([rollout_data["rewards"][i]] * rollout_data["response_lengths"][i])
                for i in range(len(rollout_data["rewards"]))
[content] /fast/home/mihir.mahajan/Projects/miles/miles/backends/fsdp_utils/actor.py (python)
        if self.args.advantage_estimator in ["grpo", "gspo"]:
            rollout_data["advantages"] = rollout_data["returns"] = [
                torch.tensor([rollout_data["rewards"][i]] * rollout_data["response_lengths"][i])
                for i in range(len(rollout_data["rewards"]))
            ]
[content] train.py (python)

            if args.loss_type == "sft_loss":
                rollout_data_val = [ray.get(rollout_manager_eval.generate.remote(rollout_id)) for _ in range(args.val_steps)]
                ray.get(actor_model.async_val(rollout_id, rollout_data_val))
            else:
                # TODO (mihir): implement val loss for other loss types
                raise NotImplementedError("Validation loss not implemented for loss type: {}".format(args.loss_type))