Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change timing logs from dendrite process_time to be timeout #187

Merged
merged 1 commit into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions prompting/dendrite.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@


class DendriteResponseEvent:
def __init__(self, responses: List[bt.Synapse], uids: torch.LongTensor):
def __init__(
self, responses: List[bt.Synapse], uids: torch.LongTensor, timeout: float
):
self.uids = uids
self.completions = [synapse.completion for synapse in responses]
self.timings = [synapse.dendrite.process_time or 0 for synapse in responses]
self.timings = [
synapse.dendrite.process_time or timeout for synapse in responses
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isn't right. needs to consider the status code.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are many possible causes for synapse.dendrite.process_time=0. we need more explicit logic

]
self.status_messages = [
synapse.dendrite.status_message for synapse in responses
]
Expand Down
4 changes: 3 additions & 1 deletion prompting/forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ async def run_step(
responses = await handle_response(responses=dict(zip(uids_cpu, responses)))

# Encapsulate the responses in a response event (dataclass)
response_event = DendriteResponseEvent(responses=responses, uids=uids)
response_event = DendriteResponseEvent(
responses=responses, uids=uids, timeout=timeout
)

bt.logging.info(f"Created DendriteResponseEvent:\n {response_event}")
# Reward the responses and get the reward result (dataclass)
Expand Down
Loading