Compare commits

..

3 Commits

Author SHA1 Message Date
Ryuichi Leo Takashige
00fc33f260 add some logs for david 2026-02-24 12:15:26 +00:00
Ryuichi Leo Takashige
93a0f5b7d5 add some logs for david 2026-02-24 12:12:38 +00:00
Ryuichi Leo Takashige
6e86e0386e add some logs for david 2026-02-24 12:08:08 +00:00
5 changed files with 32 additions and 22 deletions

View File

@@ -95,7 +95,7 @@
{#if showHome}
<button
onclick={handleHome}
class="text-sm text-white/70 hover:text-exo-yellow transition-colors tracking-wider uppercase flex items-center gap-2 cursor-pointer"
class="text-sm text-exo-light-gray hover:text-exo-yellow transition-colors tracking-wider uppercase flex items-center gap-2 cursor-pointer"
title="Back to topology view"
>
<svg
@@ -116,7 +116,7 @@
{/if}
<a
href="/#/downloads"
class="text-sm text-white/70 hover:text-exo-yellow transition-colors tracking-wider uppercase flex items-center gap-2 cursor-pointer"
class="text-sm text-exo-light-gray hover:text-exo-yellow transition-colors tracking-wider uppercase flex items-center gap-2 cursor-pointer"
title="View downloads overview"
>
{#if downloadProgress}

View File

@@ -261,13 +261,6 @@ def main():
if args.offline:
logger.info("Running in OFFLINE mode — no internet checks, local models only")
# Set trust_remote_code override env var for runner subprocesses
if args.trust_remote_code:
os.environ["EXO_TRUST_REMOTE_CODE"] = "1"
logger.warning(
"--trust-remote-code enabled: models may execute arbitrary code during loading"
)
# Set FAST_SYNCH override env var for runner subprocesses
if args.fast_synch is True:
os.environ["EXO_FAST_SYNCH"] = "on"
@@ -292,7 +285,6 @@ class Args(CamelCaseModel):
no_downloads: bool = False
offline: bool = False
fast_synch: bool | None = None # None = auto, True = force on, False = force off
trust_remote_code: bool = False
@classmethod
def parse(cls) -> Self:
@@ -344,11 +336,6 @@ class Args(CamelCaseModel):
action="store_true",
help="Run in offline/air-gapped mode: skip internet checks, use only pre-staged local models",
)
parser.add_argument(
"--trust-remote-code",
action="store_true",
help="Allow models to execute custom code during tokenizer loading (security-sensitive, CLI-only)",
)
fast_synch_group = parser.add_mutually_exclusive_group()
fast_synch_group.add_argument(
"--fast-synch",

View File

@@ -620,6 +620,34 @@ class DeepSeekShardingStrategy(TensorParallelShardingStrategy):
if on_layer_loaded is not None:
on_layer_loaded(i, total)
def log_info(stuff: nn.Module, name: str):
logger.info(f"Info for {name}:")
weights = stuff.weight
logger.info(f"Weights: {weights.shape} {weights.dtype}")
if hasattr(stuff, "scales"):
scales = stuff.scales
logger.info(f"Scales: {scales.shape} {scales.dtype}")
else:
logger.info("Scales: None")
if hasattr(stuff, "biases"):
biases = stuff.biases
logger.info(f"Biases: {biases.shape} {biases.dtype}")
else:
logger.info("Biases: None")
if i == 9:
if getattr(layer.mlp, "shared_experts", None) is not None:
log_info(
layer.mlp.shared_experts.down_proj, "Shared experts Down Proj"
)
log_info(layer.mlp.switch_mlp.gate_proj, "Switch MLP Gate Proj")
log_info(layer.self_attn.o_proj, "Self Attn O_proj")
return model

View File

@@ -13,6 +13,5 @@ KV_CACHE_BITS: int | None = None
DEFAULT_TOP_LOGPROBS: int = 5
# True for built-in models with known model cards; custom models added via API default to False
# and can be overridden with the --trust-remote-code CLI flag.
# TODO: We should really make this opt-in, but Kimi requires trust_remote_code=True
TRUST_REMOTE_CODE: bool = True

View File

@@ -291,14 +291,10 @@ def shard_and_load(
def get_tokenizer(model_path: Path, shard_metadata: ShardMetadata) -> TokenizerWrapper:
"""Load tokenizer for a model shard. Delegates to load_tokenizer_for_model_id."""
trust_remote_code = (
shard_metadata.model_card.trust_remote_code
or os.environ.get("EXO_TRUST_REMOTE_CODE") == "1"
)
return load_tokenizer_for_model_id(
shard_metadata.model_card.model_id,
model_path,
trust_remote_code=trust_remote_code,
trust_remote_code=shard_metadata.model_card.trust_remote_code,
)