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

[Bugfix] Pass config to wandb, trace interval type check #30

Merged
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
2 changes: 1 addition & 1 deletion vidur/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ class SyntheticRequestGeneratorConfig(BaseRequestGeneratorConfig):
metadata={"help": "Interval generator config for Synthetic Request Generator."},
)
num_requests: Optional[int] = field(
default=None,
default=128,
metadata={"help": "Number of requests for Synthetic Request Generator."},
)
duration: Optional[float] = field(
Expand Down
19 changes: 12 additions & 7 deletions vidur/metrics/metrics_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import plotly_express as px
import wandb

from vidur.config import ClusterConfig, MetricsConfig
from vidur.config import SimulationConfig
from vidur.entities import Batch, BatchStage, ExecutionTime, Request
from vidur.logger import init_logger
from vidur.metrics.cdf_sketch import CDFSketch
Expand Down Expand Up @@ -49,13 +49,16 @@ def wrapper(self, *args, **kwargs):

class MetricsStore:

def __init__(self, config: MetricsConfig, cluster_config: ClusterConfig) -> None:
self._config = config
def __init__(self, simulation_config: SimulationConfig) -> None:
self._simulation_config = simulation_config
self._config = self._simulation_config.metrics_config
self._last_request_arrived_at = None

# copy config
self._num_replicas = cluster_config.num_replicas
self._num_pipeline_stages = cluster_config.replica_config.num_pipeline_stages
self._num_replicas = self._simulation_config.cluster_config.num_replicas
self._num_pipeline_stages = (
self._simulation_config.cluster_config.replica_config.num_pipeline_stages
)

# Initialise request metrics
self._request_metrics_time_distributions: Dict[
Expand Down Expand Up @@ -195,7 +198,9 @@ def __init__(self, config: MetricsConfig, cluster_config: ClusterConfig) -> None
# per replica stage metrics
self._replica_busy_time = []
self._replica_mfu = []
self._mfu_calculator = MFUCalculator(cluster_config.replica_config)
self._mfu_calculator = MFUCalculator(
self._simulation_config.cluster_config.replica_config
)

for replica_idx in range(self._num_replicas):
self._replica_memory_usage.append(
Expand Down Expand Up @@ -243,7 +248,7 @@ def _init_wandb(self):
project=self._config.wandb_project,
group=self._config.wandb_group,
name=self._config.wandb_run_name,
config=self._config.to_dict(),
config=self._simulation_config.to_dict(),
)

def _save_as_csv(
Expand Down
5 changes: 3 additions & 2 deletions vidur/request_generator/synthetic_request_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from vidur.request_generator.request_length_generator_registry import (
RequestLengthGeneratorRegistry,
)
from vidur.types import RequestIntervalGeneratorType
from vidur.utils.random import set_seeds


Expand Down Expand Up @@ -67,7 +68,7 @@ def _generate_requests(self) -> List[Request]:
else:
assert (
self.config.interval_generator_config.get_type()
== RequestLengthGeneratorRegistry.TRACE
== RequestIntervalGeneratorType.TRACE
)

while True:
Expand All @@ -84,7 +85,7 @@ def generate_requests(self) -> List[Request]:
self.config.duration
or self.config.num_requests
or self.config.interval_generator_config.get_type()
== RequestLengthGeneratorRegistry.TRACE
== RequestIntervalGeneratorType.TRACE
)

set_seeds(self.config.seed)
Expand Down
4 changes: 1 addition & 3 deletions vidur/simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ def __init__(self, config: SimulationConfig) -> None:
self._config.metrics_config,
self._config.request_generator_config,
)
self._metric_store = MetricsStore(
self._config.metrics_config, self._config.cluster_config
)
self._metric_store = MetricsStore(self._config)
self._request_generator = RequestGeneratorRegistry.get(
self._config.request_generator_config.get_type(),
self._config.request_generator_config,
Expand Down
Loading