Add files using upload-large-folder tool
Browse files- 4de8d861ed2563988d5f1871647ebc5fe70861b32d24a4b32f9363518653a328/crowd-code-1409d307-b9ff-4e0c-ab0e-0cc111e3d75a1755423127885-2025_08_17-11.32.09.747/source.csv +0 -0
- 4de8d861ed2563988d5f1871647ebc5fe70861b32d24a4b32f9363518653a328/crowd-code-1bc1f935-6cba-40dc-8614-b9589f348ebe1756235407246-2025_08_26-21.10.10.19/source.csv +0 -0
- 4de8d861ed2563988d5f1871647ebc5fe70861b32d24a4b32f9363518653a328/crowd-code-312dca43-e3f1-43d3-a9bc-a71c0b4ebe381762442851031-2025_11_06-16.27.33.999/source.csv +25 -0
- 4de8d861ed2563988d5f1871647ebc5fe70861b32d24a4b32f9363518653a328/crowd-code-585eaec2-345a-44c8-b05a-f53a6d3046971761933036598-2025_10_31-18.50.42.679/source.csv +0 -0
- 4de8d861ed2563988d5f1871647ebc5fe70861b32d24a4b32f9363518653a328/crowd-code-592720c6-8212-4a7b-9b30-0ef9e3d0768e1764423985742-2025_11_29-14.46.28.653/source.csv +22 -0
- 4de8d861ed2563988d5f1871647ebc5fe70861b32d24a4b32f9363518653a328/crowd-code-71be5218-6222-4633-9d6f-27e8067fad8d1762432031736-2025_11_06-13.27.14.485/source.csv +0 -0
- 4de8d861ed2563988d5f1871647ebc5fe70861b32d24a4b32f9363518653a328/crowd-code-87ee9188-b23d-441d-9426-2b2a1e24e2711755517655598-2025_08_18-13.47.37.305/source.csv +21 -0
- 4de8d861ed2563988d5f1871647ebc5fe70861b32d24a4b32f9363518653a328/crowd-code-a5086ce0-ac41-43bb-a6fb-49a8583a615b1764420516110-2025_11_29-13.48.42.516/source.csv +0 -0
- 4de8d861ed2563988d5f1871647ebc5fe70861b32d24a4b32f9363518653a328/crowd-code-b3271939-bd4f-497b-b876-5ea890ece75f1750632226677-2025_06_22-15.43.48.822/source.csv +0 -0
- 4de8d861ed2563988d5f1871647ebc5fe70861b32d24a4b32f9363518653a328/crowd-code-c2840635-8d0b-4216-81fb-6d4064dd7cdb1758711807594-2025_09_24-13.03.29.991/source.csv +0 -0
- 4de8d861ed2563988d5f1871647ebc5fe70861b32d24a4b32f9363518653a328/crowd-code-d5ea407a-1dd6-4c7b-a9d1-ca57a06418971766657101852-2025_12_25-10.05.09.154/source.csv +72 -0
- 4de8d861ed2563988d5f1871647ebc5fe70861b32d24a4b32f9363518653a328/crowd-code-d7f8bf70-6436-4993-9f3a-388c9dd920c41755360610934-2025_08_16-18.10.16.703/source.csv +0 -0
- 4de8d861ed2563988d5f1871647ebc5fe70861b32d24a4b32f9363518653a328/crowd-code-e2abe726-9da1-4509-8b31-095e99ad14241758788312330-2025_09_25-10.18.38.778/source.csv +0 -0
- 4de8d861ed2563988d5f1871647ebc5fe70861b32d24a4b32f9363518653a328/crowd-code-f74fb5f7-5770-4723-b86e-ac735e8db6ed1762449341495-2025_11_06-18.15.45.199/source.csv +102 -0
- 4de8d861ed2563988d5f1871647ebc5fe70861b32d24a4b32f9363518653a328/crowd-code-fe6bab45-8dbd-4344-8582-4a82ec593b5b1761822935724-2025_10_30-12.15.44.980/source.csv +14 -0
- 927a8af5474e5654810c00ce2e09fd2de87d3e5722f33fa1090d867db114e403/crowd-code-02926e22-9f84-4c50-97ec-2b0fbc4d6bce1755077833038-2025_08_13-11.37.48.400/source.csv +0 -0
- 927a8af5474e5654810c00ce2e09fd2de87d3e5722f33fa1090d867db114e403/crowd-code-392753c8-d661-449c-9452-1f9aef37f3dd1751408731666-2025_07_02-00.25.54.94/source.csv +0 -0
- 927a8af5474e5654810c00ce2e09fd2de87d3e5722f33fa1090d867db114e403/crowd-code-6d45d368-d651-4f6d-8ac0-d27b6829b40f1752915727518-2025_07_19-11.02.37.733/source.csv +0 -0
- 927a8af5474e5654810c00ce2e09fd2de87d3e5722f33fa1090d867db114e403/crowd-code-c38e4133-7017-434b-b277-0fdfd25cf9ed1758613134471-2025_09_23-09.39.23.15/source.csv +0 -0
- 927a8af5474e5654810c00ce2e09fd2de87d3e5722f33fa1090d867db114e403/crowd-code-f5bc5c4e-6e75-4e39-8fc9-7d347b597b511756988790704-2025_09_04-14.26.41.759/source.csv +0 -0
4de8d861ed2563988d5f1871647ebc5fe70861b32d24a4b32f9363518653a328/crowd-code-1409d307-b9ff-4e0c-ab0e-0cc111e3d75a1755423127885-2025_08_17-11.32.09.747/source.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
4de8d861ed2563988d5f1871647ebc5fe70861b32d24a4b32f9363518653a328/crowd-code-1bc1f935-6cba-40dc-8614-b9589f348ebe1756235407246-2025_08_26-21.10.10.19/source.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
4de8d861ed2563988d5f1871647ebc5fe70861b32d24a4b32f9363518653a328/crowd-code-312dca43-e3f1-43d3-a9bc-a71c0b4ebe381762442851031-2025_11_06-16.27.33.999/source.csv
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Sequence,Time,File,RangeOffset,RangeLength,Text,Language,Type
|
| 2 |
+
2,151,"extension-output-pdoom-org.crowd-code-#1-crowd-code",0,0,"4:27:33 PM [info] Activating crowd-code\n4:27:34 PM [info] Recording started\n4:27:34 PM [info] Initializing git provider using file system watchers...\n4:27:34 PM [info] No workspace folder found\n",Log,tab
|
| 3 |
+
3,2033,"extension-output-pdoom-org.crowd-code-#1-crowd-code",194,0,"4:27:36 PM [info] Retrying git provider initialization...\n4:27:36 PM [info] No workspace folder found\n",Log,content
|
| 4 |
+
4,4847,"Untitled-1",0,0,"",plaintext,tab
|
| 5 |
+
5,777370,"Untitled-1",0,0,"hello world\n",plaintext,content
|
| 6 |
+
6,777486,"TERMINAL",0,0,"undefinedfranzsrambical@MBF6N9WFVKFV ~ % echo VSCode test",,terminal_command
|
| 7 |
+
7,777487,"TERMINAL",0,0,"]633;CVSCode test\r\n[1m[7m%[27m[1m[0m \r \r",,terminal_output
|
| 8 |
+
8,778910,"Untitled-1",0,0,"",plaintext,selection_command
|
| 9 |
+
9,778912,"Untitled-1",0,0,"hello world\n",plaintext,content
|
| 10 |
+
10,778978,"TERMINAL",0,0,"echo VSCode test",,terminal_command
|
| 11 |
+
11,778979,"TERMINAL",0,0,"]633;CVSCode test\r\n[1m[7m%[27m[1m[0m \r \r",,terminal_output
|
| 12 |
+
12,781646,"Untitled-1",0,0,"",plaintext,selection_command
|
| 13 |
+
13,781649,"Untitled-1",0,0,"hello world\n",plaintext,content
|
| 14 |
+
14,781678,"TERMINAL",0,0,"echo VSCode test",,terminal_command
|
| 15 |
+
15,781679,"TERMINAL",0,0,"]633;CVSCode test\r\n[1m[7m%[27m[1m[0m \r \r",,terminal_output
|
| 16 |
+
16,787058,"Untitled-1",24,0,"",plaintext,selection_command
|
| 17 |
+
17,787112,"Untitled-1",36,0,"",plaintext,selection_command
|
| 18 |
+
18,789432,"Untitled-1",0,0,"",plaintext,selection_command
|
| 19 |
+
19,789435,"Untitled-1",0,0,"hello world\n",plaintext,content
|
| 20 |
+
20,789498,"TERMINAL",0,0,"echo VSCode test",,terminal_command
|
| 21 |
+
21,789499,"TERMINAL",0,0,"]633;CVSCode test\r\n[1m[7m%[27m[1m[0m \r \r",,terminal_output
|
| 22 |
+
22,790233,"Untitled-1",0,0,"",plaintext,selection_command
|
| 23 |
+
23,790235,"Untitled-1",0,0,"hello world\n",plaintext,content
|
| 24 |
+
24,790263,"TERMINAL",0,0,"echo VSCode test",,terminal_command
|
| 25 |
+
25,790263,"TERMINAL",0,0,"]633;CVSCode test\r\n[1m[7m%[27m[1m[0m \r \r",,terminal_output
|
4de8d861ed2563988d5f1871647ebc5fe70861b32d24a4b32f9363518653a328/crowd-code-585eaec2-345a-44c8-b05a-f53a6d3046971761933036598-2025_10_31-18.50.42.679/source.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
4de8d861ed2563988d5f1871647ebc5fe70861b32d24a4b32f9363518653a328/crowd-code-592720c6-8212-4a7b-9b30-0ef9e3d0768e1764423985742-2025_11_29-14.46.28.653/source.csv
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Sequence,Time,File,RangeOffset,RangeLength,Text,Language,Type
|
| 2 |
+
2,108,"extension-output-pdoom-org.crowd-code-#1-crowd-code",0,0,"2:46:28 PM [info] Activating crowd-code\n2:46:28 PM [info] Recording started\n2:46:28 PM [info] Initializing git provider using file system watchers...\n2:46:28 PM [info] No workspace folder found\n",Log,tab
|
| 3 |
+
3,2035,"extension-output-pdoom-org.crowd-code-#1-crowd-code",194,0,"2:46:30 PM [info] Retrying git provider initialization...\n2:46:30 PM [info] No workspace folder found\n",Log,content
|
| 4 |
+
4,880073,"extension-output-pdoom-org.crowd-code-#1-crowd-code",249,0,"",Log,selection_mouse
|
| 5 |
+
5,882356,"Untitled-1",0,0,"",plaintext,tab
|
| 6 |
+
6,884767,"TERMINAL",0,0,"Test",,terminal_focus
|
| 7 |
+
7,884775,"Untitled-1",0,0,"// crowd-pilot mock insert\n",plaintext,content
|
| 8 |
+
8,885531,"Untitled-1",0,0,"",plaintext,selection_command
|
| 9 |
+
9,888339,"Untitled-1",27,0,"",plaintext,selection_command
|
| 10 |
+
10,888935,"Untitled-1",0,0,"",plaintext,selection_command
|
| 11 |
+
11,894522,"Untitled-1",27,0,"",plaintext,selection_command
|
| 12 |
+
12,895294,"Untitled-1",27,0,"t",plaintext,content
|
| 13 |
+
13,895298,"Untitled-1",28,0,"",plaintext,selection_keyboard
|
| 14 |
+
14,895366,"Untitled-1",28,0,"e",plaintext,content
|
| 15 |
+
15,895368,"Untitled-1",29,0,"",plaintext,selection_keyboard
|
| 16 |
+
16,895612,"Untitled-1",29,0,"s",plaintext,content
|
| 17 |
+
17,895614,"Untitled-1",30,0,"",plaintext,selection_keyboard
|
| 18 |
+
18,895619,"Untitled-1",30,0,"t",plaintext,content
|
| 19 |
+
19,895620,"Untitled-1",31,0,"",plaintext,selection_keyboard
|
| 20 |
+
20,896852,"Untitled-1",4,0,"",plaintext,selection_command
|
| 21 |
+
21,898406,"Untitled-1",3,0,"",plaintext,selection_command
|
| 22 |
+
22,899029,"Untitled-1",30,0,"",plaintext,selection_command
|
4de8d861ed2563988d5f1871647ebc5fe70861b32d24a4b32f9363518653a328/crowd-code-71be5218-6222-4633-9d6f-27e8067fad8d1762432031736-2025_11_06-13.27.14.485/source.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
4de8d861ed2563988d5f1871647ebc5fe70861b32d24a4b32f9363518653a328/crowd-code-87ee9188-b23d-441d-9426-2b2a1e24e2711755517655598-2025_08_18-13.47.37.305/source.csv
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Sequence,Time,File,RangeOffset,RangeLength,Text,Language,Type
|
| 2 |
+
2,52,"extension-output-pdoom-org.crowd-code-#1-crowd-code",0,0,"1:47:37 PM [info] Activating crowd-code\n1:47:37 PM [info] Recording started\n1:47:37 PM [info] Initializing git provider using file system watchers...\n1:47:37 PM [info] Git repository found\n1:47:37 PM [info] Git provider initialized successfully\n",Log,tab
|
| 3 |
+
3,73,"extension-output-pdoom-org.crowd-code-#1-crowd-code",245,0,"1:47:37 PM [info] Initial git state: [object Object]\n",Log,content
|
| 4 |
+
4,3784,"extension-output-pdoom-org.crowd-code-#1-crowd-code",0,0,"",Log,tab
|
| 5 |
+
5,292327,"MaxText/layers/decoders.py",0,0,"# Copyright 2023–2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the ""License"");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an ""AS IS"" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n""""""""Module for decoder layers.""""""\n# pylint: disable=arguments-differ\n# pylint: disable=no-name-in-module\n\nfrom typing import Any, Optional\nimport functools\n\nimport jax\nimport jax.numpy as jnp\nfrom jax.ad_checkpoint import checkpoint_name\nfrom jax.sharding import Mesh\n\nfrom flax import linen as nn\nfrom flax.linen.partitioning import ScanIn\n\nfrom MaxText.common_types import DecoderBlockType, Config, MODEL_MODE_TRAIN, MODEL_MODE_PREFILL, MODEL_MODE_AUTOREGRESSIVE\nfrom MaxText import max_logging\nfrom MaxText import max_utils\nfrom MaxText.inference import page_manager\nfrom MaxText.layers import linears\nfrom MaxText.layers import quantizations\nfrom MaxText.layers import pipeline\nfrom MaxText import maxtext_utils\nfrom MaxText import multimodal_utils\nfrom MaxText.layers.attentions import attention_as_linen\nfrom MaxText.layers.normalizations import rms_norm\nfrom MaxText.layers.embeddings import attend_on_embedding, embed_as_linen, positional_embedding_as_linen\nfrom MaxText.layers.quantizations import AqtQuantization as Quant\nfrom MaxText.layers import (\n deepseek,\n gemma,\n gemma2,\n gemma3,\n gpt3,\n llama2,\n llama4,\n mistral,\n mixtral,\n qwen3,\n simple_layer,\n)\n\n# ------------------------------------------------------------------------------\n# The network: Decoder Definitions\n# ------------------------------------------------------------------------------\n\n\nclass DecoderLayer(nn.Module):\n """"""\n Transformer decoder layer that attends to the encoder.\n This is the core, reusable building block for both the main model's\n decoder stack and the auxiliary MTP layers.\n """"""\n\n config: Config\n mesh: Mesh\n model_mode: str\n quant: Optional[Quant] = None\n\n @nn.compact\n def __call__(\n self,\n inputs,\n decoder_segment_ids,\n decoder_positions,\n deterministic,\n model_mode,\n previous_chunk=None,\n slot: Optional[int] = None,\n page_state: Optional[page_manager.PageState] = None,\n ):\n cfg = self.config\n mesh = self.mesh\n if model_mode == MODEL_MODE_PREFILL:\n logical_axis_names = (""activation_batch"", ""prefill_activation_length"", ""activation_embed"")\n else:\n logical_axis_names = (""activation_batch"", ""activation_length"", ""activation_embed"")\n\n if model_mode == MODEL_MODE_PREFILL:\n inputs = nn.with_logical_constraint(inputs, logical_axis_names)\n else:\n inputs = nn.with_logical_constraint(inputs, logical_axis_names)\n\n inputs = checkpoint_name(inputs, ""decoder_layer_input"")\n # inputs: embedded inputs to the decoder with shape [batch, length, emb_dim]\n lnx = rms_norm(\n num_features=inputs.shape[-1],\n dtype=cfg.dtype,\n weight_dtype=cfg.weight_dtype,\n name=""pre_self_attention_norm"",\n epsilon=cfg.normalization_layer_epsilon,\n kernel_axes=(""norm"",),\n )(inputs)\n if model_mode == MODEL_MODE_PREFILL:\n lnx = nn.with_logical_constraint(lnx, logical_axis_names)\n else:\n lnx = nn.with_logical_constraint(lnx, logical_axis_names)\n\n attention_layer = attention_as_linen(\n config=self.config,\n num_query_heads=cfg.num_query_heads,\n num_kv_heads=cfg.num_kv_heads,\n head_dim=cfg.head_dim,\n max_target_length=cfg.max_target_length,\n max_prefill_predict_length=cfg.max_prefill_predict_length,\n attention_kernel=cfg.attention,\n inputs_q_shape=lnx.shape,\n inputs_kv_shape=lnx.shape,\n mesh=mesh,\n dtype=cfg.dtype,\n weight_dtype=cfg.weight_dtype,\n dropout_rate=cfg.dropout_rate,\n name=""self_attention"",\n float32_qk_product=cfg.float32_qk_product,\n float32_logits=cfg.float32_logits,\n quant=self.quant,\n kv_quant=quantizations.configure_kv_quant(cfg),\n prefill_cache_axis_order=tuple(map(int, cfg.prefill_cache_axis_order.split("",""))),\n ar_cache_axis_order=tuple(map(int, cfg.ar_cache_axis_order.split("",""))),\n compute_axis_order=tuple(map(int, cfg.compute_axis_order.split("",""))),\n reshape_q=cfg.reshape_q,\n model_mode=model_mode,\n )\n\n attention_lnx = attention_layer(\n lnx,\n lnx,\n decoder_positions,\n decoder_segment_ids=decoder_segment_ids,\n deterministic=deterministic,\n model_mode=model_mode,\n )\n\n if model_mode == MODEL_MODE_PREFILL:\n attention_lnx = nn.with_logical_constraint(attention_lnx, logical_axis_names)\n else:\n attention_lnx = nn.with_logical_constraint(attention_lnx, logical_axis_names)\n\n # MLP block.\n mlp_lnx = linears.mlp_block(\n in_features=lnx.shape[-1],\n intermediate_dim=cfg.mlp_dim,\n activations=cfg.mlp_activations,\n intermediate_dropout_rate=cfg.dropout_rate,\n dtype=cfg.dtype,\n weight_dtype=cfg.weight_dtype,\n name=""mlp"",\n model_mode=model_mode,\n config=cfg,\n quant=self.quant,\n )(lnx, deterministic=deterministic)\n if model_mode == MODEL_MODE_PREFILL:\n mlp_lnx = nn.with_logical_constraint(mlp_lnx, logical_axis_names)\n else:\n mlp_lnx = nn.with_logical_constraint(mlp_lnx, logical_axis_names)\n\n next_layer_addition = mlp_lnx + attention_lnx\n\n next_layer_addition_dropped_out = nn.Dropout(rate=cfg.dropout_rate, broadcast_dims=(-2,))(\n next_layer_addition, deterministic=deterministic\n )\n\n layer_output = next_layer_addition_dropped_out + inputs\n if model_mode == MODEL_MODE_PREFILL:\n layer_output = nn.with_logical_constraint(\n layer_output,\n logical_axis_names,\n )\n else:\n layer_output = nn.with_logical_constraint(\n layer_output,\n logical_axis_names,\n )\n\n if cfg.record_internal_nn_metrics:\n self.sow(""intermediates"", ""activation_mean"", jnp.mean(layer_output))\n self.sow(""intermediates"", ""activation_stdev"", jnp.std(layer_output))\n self.sow(\n ""intermediates"",\n ""activation_fraction_zero"",\n jnp.sum(layer_output == 0) / jnp.size(layer_output),\n )\n\n return layer_output, None if cfg.scan_layers else layer_output\n\n\nclass SequentialBlockDecoderLayers(nn.Module):\n """"""Sequential unscanned series of decoder layers.""""""\n\n decoder_layer: Any\n num_decoder_layers: int\n config: Config\n mesh: Mesh\n quant: Quant\n model_mode: str\n\n @nn.compact\n def __call__(\n self,\n inputs: jnp.ndarray,\n decoder_segment_ids,\n decoder_positions,\n deterministic: bool,\n model_mode,\n slot: Optional[int] = None,\n page_state: Optional[page_manager.PageState] = None,\n ) -> jnp.ndarray:\n for lyr in range(self.num_decoder_layers):\n inputs = self.decoder_layer(\n config=self.config, mesh=self.mesh, name=f""layers_{lyr}"", quant=self.quant, model_mode=model_mode\n )(\n inputs,\n decoder_segment_ids,\n decoder_positions,\n deterministic,\n model_mode,\n slot=slot,\n page_state=page_state,\n )\n if self.config.scan_layers:\n inputs = inputs[0] # When scan_layers is True the decoder layers return (outputs, None).\n if self.config.scan_layers:\n return inputs, None # pytype: disable=bad-return-type\n else:\n return inputs\n\n\nclass Decoder(nn.Module):\n """"""A stack of decoder layers as a part of an encoder-decoder architecture.""""""\n\n config: Config\n shared_embedding: nn.Module\n mesh: Mesh\n quant: Optional[Quant] = None\n model_mode: str = MODEL_MODE_TRAIN\n\n def setup(self):\n """"""Initialize decoder layer.""""""\n self.decoder_layer = self.get_decoder_layers()\n self.norm_layer = self.get_norm_layer(num_features=self.config.emb_dim)\n if self.config.using_pipeline_parallelism:\n pipeline_stage_module = self.get_pipeline_stage_module(self.decoder_layer)\n remat_policy = self.get_remat_policy()\n self.pipeline_module = pipeline.Pipeline(\n config=self.config, mesh=self.mesh, layers=pipeline_stage_module, remat_policy=remat_policy\n )\n\n def get_remat_policy(self):\n """"""Get remat policy""""""\n policy = None\n cfg = self.config\n if cfg.remat_policy != ""none"":\n if cfg.remat_policy == ""minimal"":\n policy = jax.checkpoint_policies.checkpoint_dots_with_no_batch_dims\n elif cfg.remat_policy == ""save_dot_with_context_except_mlp"":\n policy = jax.checkpoint_policies.save_only_these_names(\n ""query_proj"",\n ""value_proj"",\n ""key_proj"",\n ""qkv_proj"",\n ""context"",\n ""out_proj"",\n )\n elif cfg.remat_policy == ""save_dot_except_mlpwi"":\n policy = jax.checkpoint_policies.save_only_these_names(\n ""query_proj"",\n ""value_proj"",\n ""key_proj"",\n ""qkv_proj"",\n ""out_proj"",\n ""mlpwo"",\n )\n elif cfg.remat_policy == ""save_dot_except_mlp"":\n policy = jax.checkpoint_policies.save_only_these_names(\n ""query_proj"",\n ""value_proj"",\n ""key_proj"",\n ""qkv_proj"",\n ""out_proj"",\n )\n elif cfg.remat_policy == ""save_qkv_proj"":\n policy = jax.checkpoint_policies.save_only_these_names(\n ""query_proj"",\n ""value_proj"",\n ""key_proj"",\n ""qkv_proj"",\n )\n elif cfg.remat_policy == ""qkv_proj_offloaded"":\n policy = jax.checkpoint_policies.save_and_offload_only_these_names(\n names_which_can_be_saved=[],\n names_which_can_be_offloaded=[""query_proj"", ""value_proj"", ""key_proj""],\n offload_src=""device"",\n offload_dst=""pinned_host"",\n )\n elif cfg.remat_policy == ""minimal_offloaded"":\n policy = jax.checkpoint_policies.offload_dot_with_no_batch_dims(offload_src=""device"", offload_dst=""pinned_host"")\n elif cfg.remat_policy == ""custom"":\n policy = jax.checkpoint_policies.save_and_offload_only_these_names(\n names_which_can_be_saved=cfg.tensors_on_device,\n names_which_can_be_offloaded=cfg.tensors_to_offload,\n offload_src=""device"",\n offload_dst=""pinned_host"",\n )\n elif cfg.remat_policy == ""minimal_flash"":\n policy = jax.checkpoint_policies.save_from_both_policies(\n jax.checkpoint_policies.checkpoint_dots_with_no_batch_dims,\n jax.checkpoint_policies.save_only_these_names(\n ""context"",\n ),\n )\n elif cfg.remat_policy == ""save_out_proj"":\n policy = jax.checkpoint_policies.save_only_these_names(\n ""out_proj"",\n )\n else:\n assert cfg.remat_policy == ""full"", ""Remat policy needs to be on list of remat policies""\n policy = None\n return policy\n\n def get_decoder_layers(self):\n """"""Retrieves a list of decoder layer classes based on the `decoder_block` config.\n\n Returns:\n A list containing one or more `nn.Module` classes for the decoder.\n """"""\n match self.config.decoder_block:\n case DecoderBlockType.DEFAULT:\n return [DecoderLayer]\n case DecoderBlockType.LLAMA2:\n return [llama2.LlamaDecoderLayer]\n case DecoderBlockType.MISTRAL:\n # TODO(ranran): update to Mistral with sliding window attention\n return [mistral.MistralDecoderLayer]\n case DecoderBlockType.MIXTRAL:\n return [mixtral.MixtralDecoderLayer]\n case DecoderBlockType.DEEPSEEK:\n return [deepseek.DeepSeekDenseLayer, deepseek.DeepSeekMoELayer]\n case DecoderBlockType.GEMMA:\n return [gemma.GemmaDecoderLayer]\n case DecoderBlockType.GEMMA2:\n return [gemma2.Gemma2DecoderLayer]\n case DecoderBlockType.GEMMA3:\n return [gemma3.Gemma3DecoderLayer]\n case DecoderBlockType.GPT3:\n return [gpt3.Gpt3DecoderLayer]\n case DecoderBlockType.QWEN3:\n return [qwen3.Qwen3DecoderLayer]\n case DecoderBlockType.QWEN3_MOE:\n return [qwen3.Qwen3MoeDecoderLayer]\n case DecoderBlockType.SIMPLE:\n return [simple_layer.SimpleDecoderLayer]\n case DecoderBlockType.SIMPLE_MLP:\n return [simple_layer.SimpleMlpDecoderLayer]\n case DecoderBlockType.LLAMA4:\n return [llama4.Llama4ScannableBlock] if self.config.scan_layers else [llama4.Llama4DecoderLayer]\n case _:\n # Default case to handle any unknown decoder block types.\n raise ValueError(f""Incorrect decoder_block name {self.config.decoder_block.value=}"")\n\n def set_remat_policy(self, block_layers, policy):\n """"""Set remat policy""""""\n RemattedBlockLayers = []\n for block_layer in block_layers:\n if self.config.parameter_memory_host_offload:\n # Define parameter movement with mesh-based sharding\n def move_to_device(variables):\n """"""Move parameters to device with proper sharding.""""""\n\n def map_fn(path, value):\n max_logging.log(f""models.py: Moving parameter {path} to device"")\n return jax.device_put(\n value, max_utils.device_space()\n )\n\n return jax.tree_util.tree_map_with_path(map_fn, variables)\n\n # Transform layer class before remat\n block_layer = nn.map_variables(block_layer, [""params""], move_to_device, mutable=True)\n\n # Apply remat policy to layer\n layer = nn.remat(\n block_layer,\n prevent_cse=not self.config.scan_layers,\n policy=policy,\n static_argnums=(4, 5), # Deterministic and model mode are static arguments.\n )\n RemattedBlockLayers.append(layer)\n return RemattedBlockLayers\n\n def get_norm_layer(self, num_features: int):\n """"""get normalization layer (return type inherits from nn.Module)""""""\n if self.config.decoder_block in (\n DecoderBlockType.DEFAULT,\n DecoderBlockType.LLAMA2,\n DecoderBlockType.MISTRAL,\n DecoderBlockType.MIXTRAL,\n DecoderBlockType.DEEPSEEK,\n DecoderBlockType.GEMMA,\n DecoderBlockType.GEMMA2,\n DecoderBlockType.GEMMA3,\n DecoderBlockType.QWEN3,\n DecoderBlockType.QWEN3_MOE,\n DecoderBlockType.SIMPLE,\n DecoderBlockType.SIMPLE_MLP,\n DecoderBlockType.LLAMA4,\n ):\n return functools.partial(rms_norm, num_features=num_features)\n elif self.config.decoder_block == DecoderBlockType.GPT3:\n return functools.partial(gpt3.gpt3_layer_norm, num_features=num_features, reductions_in_fp32=False, use_bias=True)\n else:\n raise ValueError(f""Incorrect decoder_block name {self.config.decoder_block.value=}"")\n\n def scan_decoder_layers(self, cfg, decoder_layer, length, metadata_axis_name, mesh, in_axes_tuple, model_mode, **kwargs):\n """"""scan decoder layers, calls `flax.linen.transforms.scan`""""""\n initializing = self.is_mutable_collection(""params"")\n params_spec = cfg.param_scan_axis if initializing else ScanIn(cfg.param_scan_axis)\n cache_spec = 0\n scan_fn = nn.scan(\n decoder_layer,\n variable_axes={\n ""params"": params_spec,\n ""cache"": cache_spec,\n ""intermediates"": 0,\n ""aqt"": 0,\n ""_overwrite_with_gradient"": 0,\n },\n split_rngs={\n ""params"": True,\n ""dropout"": cfg.enable_dropout,\n },\n in_axes=in_axes_tuple,\n length=length,\n metadata_params={nn.PARTITION_NAME: metadata_axis_name},\n )\n return scan_fn(config=cfg, mesh=mesh, name=metadata_axis_name, quant=self.quant, model_mode=model_mode, **kwargs)\n\n def get_pipeline_stage_module(self, decoder_blocks):\n """"""get pipeline stage module""""""\n\n def get_layer_to_pipeline(blocks, cfg):\n if cfg.decoder_block == DecoderBlockType.DEEPSEEK:\n return blocks[1] # return the sparse block\n else:\n return blocks[0]\n\n cfg = self.config\n base_stage = get_layer_to_pipeline(decoder_blocks, cfg)\n if cfg.set_remat_policy_on_layers_per_stage:\n policy = self.get_remat_policy()\n base_stage = self.set_remat_policy([base_stage], policy)[0]\n if cfg.num_layers_per_pipeline_stage == 1:\n stage_module = base_stage(config=cfg, mesh=self.mesh, quant=self.quant, model_mode=self.model_mode)\n elif cfg.scan_layers_per_stage:\n stage_module = self.scan_decoder_layers(\n cfg,\n base_stage,\n cfg.num_layers_per_pipeline_stage,\n ""layers_per_stage"",\n self.mesh,\n in_axes_tuple=(nn.broadcast,) * 4,\n model_mode=self.model_mode,\n )\n else:\n stage_module = SequentialBlockDecoderLayers(\n decoder_layer=base_stage,\n num_decoder_layers=cfg.num_layers_per_pipeline_stage,\n config=cfg,\n mesh=self.mesh,\n quant=self.quant,\n model_mode=self.model_mode,\n )\n return stage_module\n\n @nn.compact\n def _apply_embedding(\n self,\n decoder_input_tokens,\n decoder_positions,\n deterministic,\n model_mode,\n image_embeddings=None,\n bidirectional_mask=None,\n ):\n """"""Applies token and positional embeddings to the input tokens.""""""\n cfg = self.config\n\n y = self.shared_embedding(decoder_input_tokens.astype(""int32""), model_mode=model_mode)\n\n # Merge the image embeddings with the text embeddings for multimodal models\n if image_embeddings is not None and cfg.use_multimodal:\n if cfg.model_name in [""gemma3-4b"", ""gemma3-12b"", ""gemma3-27b"", ""llama4-17b-16e"", ""llama4-17b-128e""]:\n y = multimodal_utils.merge_mm_embeddings(\n text_embeddings=y,\n vision_embeddings=image_embeddings,\n mask=bidirectional_mask,\n )\n # TODO(hengtaoguo): Add support for other multimodal models such as Llama4, refactor if needed\n else:\n raise ValueError(f""Unsupported model_name for multimodal: {cfg.model_name}"")\n\n y = nn.Dropout(rate=cfg.dropout_rate, broadcast_dims=(-2,))(y, deterministic=deterministic)\n y = y.astype(cfg.dtype)\n\n if cfg.use_untrainable_positional_embedding:\n y = positional_embedding_as_linen(embedding_dims=cfg.base_emb_dim)(y, decoder_positions)\n\n if cfg.trainable_position_size > 0:\n y += embed_as_linen(\n num_embeddings=cfg.trainable_position_size,\n num_features=cfg.emb_dim,\n dtype=cfg.dtype,\n embedding_init=nn.initializers.normal(stddev=1.0),\n name=""position_embedder"",\n config=cfg,\n )(decoder_positions, model_mode=model_mode)\n return y\n\n @nn.compact\n def _apply_output_head(self, y, deterministic, model_mode):\n """"""Applies final normalization and projects hidden states to logits.""""""\n\n cfg = self.config\n y = self.get_norm_layer(num_features=y.shape[-1])(\n dtype=cfg.dtype,\n weight_dtype=cfg.weight_dtype,\n name=""decoder_norm"",\n epsilon=cfg.normalization_layer_epsilon,\n kernel_axes=(""norm"",),\n parameter_memory_host_offload=cfg.parameter_memory_host_offload,\n )(y)\n y = nn.Dropout(rate=cfg.dropout_rate, broadcast_dims=(-2,))(y, deterministic=deterministic)\n\n # [batch, length, emb_dim] -> [batch, length, vocab_size]\n if cfg.logits_via_embedding:\n # Use the transpose of embedding matrix for logit transform.\n embedding_table = self.shared_embedding.variables[""params""][""embedding""]\n if isinstance(embedding_table, nn.spmd.LogicallyPartitioned):\n embedding_table = embedding_table.unbox()\n attend_dtype = jnp.float32 if cfg.logits_dot_in_fp32 else cfg.dtype\n logits = attend_on_embedding(y, embedding_table, attend_dtype, self.config)\n\n if self.config.normalize_embedding_logits:\n # Correctly normalize pre-softmax logits for this shared case.\n logits = logits / jnp.sqrt(y.shape[-1])\n if cfg.final_logits_soft_cap:\n logits = logits / cfg.final_logits_soft_cap\n logits = jnp.tanh(logits) * cfg.final_logits_soft_cap\n else:\n logits = linears.dense_general(\n inputs_shape=y.shape,\n out_features_shape=cfg.vocab_size,\n weight_dtype=cfg.weight_dtype,\n dtype=jnp.float32 if cfg.logits_dot_in_fp32 else cfg.dtype, # for logit training stability\n kernel_axes=(""embed"", ""vocab""),\n name=""logits_dense"",\n matmul_precision=self.config.matmul_precision,\n parameter_memory_host_offload=cfg.parameter_memory_host_offload,\n )(\n y\n ) # We do not quantize the logits matmul.\n if model_mode in (MODEL_MODE_PREFILL, MODEL_MODE_AUTOREGRESSIVE):\n logits = nn.with_logical_constraint(logits, (None, None, ""activation_vocab""))\n else:\n logits = nn.with_logical_constraint(\n logits, (""activation_embed_and_logits_batch"", ""activation_length"", ""activation_vocab"")\n )\n\n if self.config.cast_logits_to_fp32:\n logits = logits.astype(jnp.float32)\n\n return logits\n\n @nn.compact\n def __call__(\n self,\n decoder_input_tokens,\n decoder_positions,\n decoder_segment_ids=None,\n deterministic=False,\n model_mode=MODEL_MODE_TRAIN,\n previous_chunk=None,\n slot: Optional[int] = None,\n page_state: Optional[page_manager.PageState] = None,\n bidirectional_mask: Optional[Any] = None,\n image_embeddings: Optional[jnp.ndarray] = None,\n ):\n cfg = self.config\n mesh = self.mesh\n assert decoder_input_tokens.ndim == 2 # [batch, len]\n\n # [batch, length] -> [batch, length, emb_dim]\n y = self._apply_embedding(\n decoder_input_tokens, decoder_positions, deterministic, model_mode, image_embeddings, bidirectional_mask\n )\n\n policy = self.get_remat_policy()\n RemattedBlockLayers = self.set_remat_policy(self.decoder_layer, policy)\n # scan does not support kwargs in layer call, passing broadcast_args as positional arg\n broadcast_args = (\n decoder_segment_ids,\n decoder_positions,\n deterministic,\n model_mode,\n )\n if cfg.using_pipeline_parallelism:\n if cfg.pipeline_fsdp_ag_once:\n partition_spec = self.pipeline_module.get_weight_sharding(\n y, decoder_segment_ids, decoder_positions, deterministic, model_mode\n )\n else:\n partition_spec = None # This partition spec is only used for the fsdp_ag_once feature.\n if cfg.decoder_block == DecoderBlockType.DEEPSEEK:\n assert len(RemattedBlockLayers) == 2, ""Scanned layers must have a length of 2 using deepseek.""\n dense_layer = RemattedBlockLayers[0]\n moe_layer = RemattedBlockLayers[1]\n num_moe_layers = cfg.num_decoder_layers - cfg.first_num_dense_layers\n num_moe_layers_outside_pp = num_moe_layers - self.config.pipeline_parallel_layers\n logical_axis_rules_pp_as_dp = maxtext_utils.logical_axis_rules_pp_act_as_dp(self.config.logical_axis_rules)\n # We chose not to pipeline the dense layers, only sparse for SPMD.\n with self.mesh, nn.partitioning.axis_rules(logical_axis_rules_pp_as_dp):\n y, _ = self.scan_decoder_layers(\n cfg,\n dense_layer,\n cfg.first_num_dense_layers,\n ""dense_layers"",\n mesh,\n in_axes_tuple=(nn.broadcast,) * len(broadcast_args),\n model_mode=model_mode,\n )(y, *broadcast_args)\n if num_moe_layers_outside_pp > 0:\n y, _ = self.scan_decoder_layers(\n cfg,\n moe_layer,\n num_moe_layers_outside_pp,\n ""moe_layers"",\n mesh,\n in_axes_tuple=(nn.broadcast,) * len(broadcast_args),\n model_mode=model_mode,\n )(y, *broadcast_args)\n y = self.pipeline_module(y, *broadcast_args, partition_spec=partition_spec)\n else: # Not DeepSeek\n y = self.pipeline_module(y, *broadcast_args, partition_spec=partition_spec)\n remaining_layers = self.config.num_decoder_layers - self.config.pipeline_parallel_layers\n if remaining_layers > 0:\n logical_axis_rules_pp_as_dp = maxtext_utils.logical_axis_rules_pp_act_as_dp(self.config.logical_axis_rules)\n with self.mesh, nn.partitioning.axis_rules(logical_axis_rules_pp_as_dp):\n y, _ = self.scan_decoder_layers(\n cfg,\n RemattedBlockLayers[0],\n remaining_layers,\n ""layers_outside_pipeline"",\n mesh,\n in_axes_tuple=(nn.broadcast,) * len(broadcast_args),\n model_mode=model_mode,\n )(y, *broadcast_args)\n else:\n if cfg.scan_layers:\n if cfg.decoder_block == DecoderBlockType.DEEPSEEK:\n assert len(RemattedBlockLayers) == 2, ""Scanned layers must have a length of 2 using deepseek.""\n layer_call_kwargs = {\n ""page_state"": page_state,\n ""previous_chunk"": previous_chunk,\n ""slot"": slot,\n }\n dense_layer = RemattedBlockLayers[0]\n dense_layer.__call__ = functools.partial(dense_layer.__call__, **layer_call_kwargs)\n y, _ = self.scan_decoder_layers(\n cfg,\n dense_layer,\n cfg.first_num_dense_layers,\n ""dense_layers"",\n mesh,\n in_axes_tuple=(nn.broadcast,) * len(broadcast_args),\n model_mode=model_mode,\n )(y, *broadcast_args)\n moe_layer = RemattedBlockLayers[1]\n moe_layer.__call__ = functools.partial(moe_layer.__call__, **layer_call_kwargs)\n num_moe_layers = cfg.num_decoder_layers - cfg.first_num_dense_layers\n y, _ = self.scan_decoder_layers(\n cfg,\n moe_layer,\n num_moe_layers,\n ""moe_layers"",\n mesh,\n in_axes_tuple=(nn.broadcast,) * len(broadcast_args),\n model_mode=model_mode,\n )(y, *broadcast_args)\n elif cfg.decoder_block == DecoderBlockType.GEMMA3:\n y = self._apply_gemma3_scanned_blocks(\n y,\n decoder_segment_ids,\n decoder_positions,\n deterministic,\n model_mode,\n bidirectional_mask,\n previous_chunk,\n page_state,\n slot,\n )\n else:\n RemattedBlockLayer = RemattedBlockLayers[0]\n scan_length = int(cfg.num_decoder_layers / cfg.inhomogeneous_layer_cycle_interval)\n layer_kwargs = {}\n if cfg.decoder_block == DecoderBlockType.LLAMA4:\n layer_kwargs = {\n ""nope_layer_interval"": self.config.nope_layer_interval,\n ""interleave_moe_layer_step"": self.config.interleave_moe_layer_step,\n }\n broadcast_args += (bidirectional_mask,)\n y, _ = self.scan_decoder_layers(\n cfg,\n RemattedBlockLayer,\n scan_length,\n ""layers"",\n mesh,\n in_axes_tuple=(nn.broadcast,) * len(broadcast_args),\n model_mode=model_mode,\n **layer_kwargs,\n )(y, *broadcast_args)\n else:\n if cfg.decoder_block == DecoderBlockType.DEEPSEEK:\n assert len(RemattedBlockLayers) == 2, ""Unscanned layers must have a length of 2 using deepseek.""\n dense_layer = RemattedBlockLayers[0]\n moe_layer = RemattedBlockLayers[1]\n\n layers = [dense_layer, moe_layer]\n layer_prefixes = [""dense_layers"", ""moe_layers""]\n num_moe_layers = cfg.num_decoder_layers - cfg.first_num_dense_layers\n num_layers_list = [cfg.first_num_dense_layers, num_moe_layers]\n # Iterate over the two layer groups (dense and MoE) and apply layer transformation\n for layer, num_layers, layer_prefix in zip(layers, num_layers_list, layer_prefixes):\n for index in range(num_layers):\n y = layer(config=cfg, mesh=mesh, name=f""{layer_prefix}_{index}"", quant=self.quant, model_mode=self.model_mode)(\n y,\n decoder_segment_ids,\n decoder_positions,\n deterministic,\n model_mode,\n previous_chunk=previous_chunk,\n page_state=page_state,\n slot=slot,\n )\n else:\n for lyr in range(cfg.num_decoder_layers):\n RemattedBlockLayer = RemattedBlockLayers[0]\n layer_kwargs = {}\n layer_call_kwargs = {}\n if cfg.decoder_block == DecoderBlockType.GEMMA3:\n # Gemma3 uses both global and sliding window attention depending on the layer index.\n layer_kwargs = {""attention_type"": gemma3.get_attention_type(layer_id=lyr)}\n layer_call_kwargs = {""bidirectional_mask"": bidirectional_mask}\n if cfg.decoder_block == DecoderBlockType.LLAMA4:\n layer_kwargs = {\n ""is_nope_layer"": llama4.determine_is_nope_layer(lyr, self.config.nope_layer_interval),\n ""is_moe_layer"": llama4.determine_is_moe_layer(lyr, self.config.interleave_moe_layer_step),\n }\n layer_call_kwargs = {""bidirectional_mask"": bidirectional_mask}\n layer = RemattedBlockLayer(\n config=cfg, mesh=mesh, name=f""layers_{lyr}"", quant=self.quant, model_mode=self.model_mode, **layer_kwargs\n )\n y = layer(\n y,\n decoder_segment_ids,\n decoder_positions,\n deterministic,\n model_mode,\n previous_chunk=previous_chunk,\n page_state=page_state,\n slot=slot,\n **layer_call_kwargs,\n )\n\n assert isinstance(y, jax.Array)\n\n # After the final transformer layer, `y` holds the raw, un-normalized hidden state.\n hidden_state = y\n\n logits = self._apply_output_head(hidden_state, deterministic, model_mode)\n\n # The API of the Decoder is now a tuple, providing both the main output\n # and the raw hidden state needed for auxiliary tasks.\n return logits, hidden_state\n\n def _apply_gemma3_scanned_blocks(\n self,\n y,\n decoder_segment_ids,\n decoder_positions,\n deterministic,\n model_mode,\n bidirectional_mask,\n previous_chunk,\n page_state,\n slot,\n ):\n """"""Applies Gemma3 scanned decoder blocks, handling main scan and remainders.""""""\n\n cfg = self.config\n mesh = self.mesh\n\n # Define the repeating pattern length and calculate how many full blocks to scan\n attention_pattern_length = len(gemma3.GEMMA3_ATTENTION_PATTERN)\n scan_length = cfg.num_decoder_layers // attention_pattern_length\n\n policy = self.get_remat_policy()\n RemattedGemma3Block = self.set_remat_policy([gemma3.Gemma3ScannableBlock], policy)[0]\n\n layer_call_kwargs = {""bidirectional_mask"": bidirectional_mask}\n layer_kwargs = {""num_of_layers"": attention_pattern_length}\n\n # Apply the main scan over the full blocks\n if scan_length > 0:\n broadcast_args = (\n decoder_segment_ids,\n decoder_positions,\n deterministic,\n model_mode,\n )\n y, _ = self.scan_decoder_layers(\n cfg,\n RemattedGemma3Block,\n scan_length,\n ""layers"",\n mesh,\n in_axes_tuple=(nn.broadcast,) * len(broadcast_args),\n model_mode=model_mode,\n **layer_kwargs,\n )(y, *broadcast_args, **layer_call_kwargs)\n\n # Apply any remaining layers that did not fit into a full scanned block\n num_remaining_layers = cfg.num_decoder_layers % attention_pattern_length\n if num_remaining_layers > 0:\n # We name the remainder block with a 'remainder' suffix to avoid parameter name collisions\n rem_layer_kwargs = {""num_of_layers"": num_remaining_layers}\n layer = RemattedGemma3Block(\n config=cfg, mesh=mesh, quant=self.quant, model_mode=self.model_mode, name=""layers_remainder"", **rem_layer_kwargs\n )\n y, _ = layer(\n y,\n decoder_segment_ids,\n decoder_positions,\n deterministic,\n model_mode,\n previous_chunk=previous_chunk,\n page_state=page_state,\n slot=slot,\n **layer_call_kwargs,\n )\n return y\n",python,tab
|
| 6 |
+
6,292328,"MaxText/layers/decoders.py",19853,742," attend_dtype = jnp.float32 if cfg.logits_dot_in_fp32 else cfg.dtype\n logits = attend_on_embedding(y, embedding_table, attend_dtype, self.config)\n\n if self.config.normalize_embedding_logits:\n # Correctly normalize pre-softmax logits for this shared case.\n logits = logits / jnp.sqrt(y.shape[-1])\n if cfg.final_logits_soft_cap:\n logits = logits / cfg.final_logits_soft_cap\n logits = jnp.tanh(logits) * cfg.final_logits_soft_cap\n else:\n logits = linears.dense_general(\n inputs_shape=y.shape,\n out_features_shape=cfg.vocab_size,\n weight_dtype=cfg.weight_dtype,\n dtype=jnp.float32 if cfg.logits_dot_in_fp32 else cfg.dtype, # for logit training stability",python,selection_command
|
| 7 |
+
7,296518,"MaxText/layers/decoders.py",19926,0,"",python,selection_mouse
|
| 8 |
+
8,296532,"MaxText/layers/decoders.py",19925,0,"",python,selection_command
|
| 9 |
+
9,297549,"MaxText/layers/decoders.py",19900,0,"",python,selection_mouse
|
| 10 |
+
10,344869,"MaxText/configs/base.yml",0,0,"# Copyright 2023–2025 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the ""License"");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an ""AS IS"" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n# This sentinel is a reminder to choose a real run name.\n# If there is already a checkpoint under this run, that checkpoint will auto-resume.\nrun_name: """"\n\nmodel_name: ""default"" # override config settings to match a specific model. other than the override, nothing should use this!\noverride_model_config: False # When set to true allows overriding model parameters via CLI for the purpose of debugging/testing.\nnormalization_layer_epsilon: 1.e-05\n\n################################## CHECKPOINTING ##################################\n# Checkpointing makes the following choices in the following order, starting with (1):\n# (1) If there is already a checkpoint for this run_name, we load the latest entire checkpoint.\n# This ensures if we're resuming a run after preemption or hardware failure we lose minimum state.\n# (2) Same priority and mutually exclusive -- you can't set both!\n# * If load_parameters_path is set, we load a parameter only checkpoint from that path.\n# * If load_full_state_path is set, we load a full state checkpoint from that path.\n# (3) We don't load a checkpoint and initialize state instead!\n\n# Loads a just parameters from a specific directory\n# e.g. gs://my-base-output-directory/my-previous-run-name/checkpoints/items/NUMBER or NUMBER/items\nload_parameters_path: """"\n\n# LoRA adapter support configs\nlora_input_adapters_path: """" # Input GCS path for a parent directory which has all the LoRA adapters (lora_id as subdir)\n\n# Loads a full checkpoint including optimizer state and step count from a specific directory\n# e.g. gs://my-base-output-directory/my-previous-run-name/checkpoints/items/NUMBER or NUMBER/items\nload_full_state_path: """"\n\n# If enable_checkpointing is true, an asynchronous checkpointer will be used if\n# async_checkpointing is true, else a synchronous one is used. If you have\n# problems with the checkpointer we recommend trying the synchronous one.\nenable_checkpointing: True\nasync_checkpointing: True\ncheckpoint_period: 10_000\n# enables one replica to read the ckpt then broadcast to the rest\nenable_single_replica_ckpt_restoring: False\n\nforce_unroll: False # during generate_param_only_checkpoint should we unroll the loop?\n\n# checkpointing using orbax has two important parameters: array driver\n# and its underlying storage - the kvstore (preferably ocdbt)\n# orbax supports setting a target file size, chunking a single\n# large arrays into small physical files (<2GB) can speed up distributed and over\n# the network loading enormously\ncheckpoint_storage_target_data_file_size_bytes: 2147483648\ncheckpoint_storage_use_ocdbt: True\ncheckpoint_storage_use_zarr3: True\n# larger models requires higher concurrent GB for I/O\n# default concurrent gb for PytreeCheckpointHandler is 96GB\ncheckpoint_storage_concurrent_gb: 96\n\n# Bool flag for enabling Orbax v1.\nenable_orbax_v1: False\n# Function for processing loaded checkpoint dict into a format MaxText can understand. (for other formats, i.e. SafeTensors)\ncheckpoint_conversion_fn: None\n# Optional checkpoint context to use for loading. Options: ""orbax"", ""safetensors""\nsource_checkpoint_layout: ""orbax""\n############################### END CHECKPOINTING ##################################\n\n\nreuse_example_batch: 0 # for testing TPU performance, this options repeated uses the same batch.\n\n\nmetrics_file: """" # for testing, local file that stores scalar metrics. If empty, no metrics are written.\n# If true save metrics such as loss and TFLOPS to GCS in {base_output_directory}/{run_name}/metrics/\ngcs_metrics: False\n\n# If true save config to GCS in {base_output_directory}/{run_name}/\nsave_config_to_gcs: False\n\n# Activation dtypes.\ndtype: ""bfloat16""\n# Used to configure quantization in the transformer layers, defaults to null implying bf16.\n# Possible alternative settings are as follows:\n# 'int8' for dynamic range quantization using 8-bits\n# 'intmp' for mixed precision quantization for inference as described here: MaxText/configs/quantization/README.md\n# 'fp8' for 8-bit floating-point GeMMs on NVIDIA GPUs.\n# 'nanoo_fp8' for 8-bit floating-point GeMMs on AMD MI300/MI325 GPUs.\n# 'fp8_full' for FP8 quantization with static scaling.\nquantization: """"\n# Used to configure constant_bound_config in aqt lib for static scaling, e.g. constant_bound_config='0.5, 0.5, 0.5, 0.5, 0.5, 0.5'\nconstant_bound_config: """"\n# Choose one of default, high, and highest.\n# https://kolonist26-jax-kr.readthedocs.io/en/latest/jax.lax.html#jax.lax.Precision\nmatmul_precision: ""default""\nactivations_in_float32: False # Sets activations to float32 before nonlinearity it true, else dtype\n# Used to replicate the quantization scale to avoid the inefficient XLA fusion for 2d sharding.\nreplicate_quant_scale: False\n# Path to file with quantization config for intmp.\nquant_cfg_path: """"\nquantize_kvcache: False # Set to True to quantize KV Cache values, defaults to False\n# Valid kv_quant_axis values:\n# - """" is valid only when quantize_kvcache is False\n# - ""dkv"" indicates quantize kv cache over the cache_kv, i.e. kv dimension axis\n# - ""heads_and_dkv"" indicates quantize kv cache over cache_heads and cache_kv axes\n# Default to ""heads_and_dkv"" for faster compution, kv_quant_axis is not used when quantize_kvcache is False\n# - ""dkv"" is expected with better accuracy but degraded computation\nkv_quant_axis: ""heads_and_dkv""\nkv_quant_dtype: ""int8""\ncheckpoint_is_quantized: False # Set to True if reading from a saved aqt quantized checkpoint\n# Saves params quantized on fly at following path\nsave_quantized_params_path: """"\n#Used to configure the mode in which model is called\n# when left as is, corresponds to training\n# accepted values are ""inference""\nmodel_call_mode: """"\nuse_qwix_quantization: False # Whether to use qwix for quantization. If set to True, the model will be quantized using qwix.\n# Quantization calibration method used for weights and activations. Supported methods can be found in https://github.com/google/qwix/blob/dc2a0770351c740e5ab3cce7c0efe9f7beacce9e/qwix/qconfig.py#L70-L80\nquantization_calibration_method: ""absmax""\n# Shard the range finding operation for quantization. By default this is set to number of slices.\nquantization_local_shard_count: -1\n\ndecoder_block: ""llama2"" # which style of DecoderBlock to use.\n# Global parameter scale needs to be a power of 2. If you want finer grained control of the model sizes\n# then you should explicitly set base_embed_dim, base_num_query_heads, base_num_kv_heads,\n# base_mlp_dim, base_num_decoder_layers and/or head_dim.\nweight_dtype: ""float32""\nglobal_parameter_scale: 1\nbase_emb_dim: 2048\nbase_num_query_heads: 16\nbase_num_kv_heads: 16\nbase_mlp_dim: 7168\nbase_num_decoder_layers: 16\nhead_dim: 128\nmlp_activations: [""silu"", ""linear""]\ndropout_rate: 0.0\nlogits_via_embedding: False\nnormalize_embedding_logits: True # whether to normalize pre-softmax logits if logits_via_embedding is true\nlogits_dot_in_fp32: False # whether to use fp32 in logits_dense or shared_embedding dot product for stability\ncast_logits_to_fp32: True # whether to cast the logits to fp32. The higher precision is generally beneficial, but it can vary slightly.\nfloat32_qk_product: False # in dot_product attention, whether to cast to fp32 the inputs to qk product\nfloat32_logits: False # in dot_product attention, whether to cast to fp32 the inputs to softmax\n\n# Multi-Token Prediction Configs\n# The number of auxiliary prediction layers to use for MTP.\n# Set to 0 to disable the feature.\nmtp_num_layers: 0\n# The scaling factor (lambda) for the MTP auxiliary loss. The final loss is:\n# main_loss + mtp_loss_scaling_factor * avg_mtp_loss\nmtp_loss_scaling_factor: 0.1\n# Specifies which MTP layer (1-indexed) is used to calculate metrics like the\n# acceptance rate during evaluation. For example, a value of `1` targets the\n# first auxiliary prediction head. Set to 0 to disable this specific evaluation\nmtp_eval_target_module: 0\n\n# mixture of experts (moe)\nnum_experts: 1\nnum_experts_per_tok: 1\nmegablox: True\nsparse_matmul: True\ncapacity_factor: -1.0 # a factor to decide expert capacity for token dropping, and no dropping by default\nload_balance_loss_weight: 0.01 # weight for the load balance loss\nuse_random_routing: False # whether to use random routing for debug/test purpose\n# Tunable tiling dimensions used for Megablox\ntile_batch_seq: 512\ntile_activation_dim: 1024\ntile_weight_dim: 1024\nnorm_topk_prob: False # Boolean to enable the top-k probability normalization. Qwen3-specific normalization of router weights.\n\n# How the expert axis is used to shard attention weights and activations\n# ""fsdp"" (ep acts as fsdp parallelism)\n# ""context"" (ep acts as context parallelism, training only)\nexpert_shard_attention_option: ""fsdp""\n\n# deepseek moe\nbase_moe_mlp_dim: 7168 # intermediate dimension at MoE layer (use base_mlp_dim if not DeepSeek style)\nfirst_num_dense_layers: 0 # number of initial dense layers in the model\nshared_experts: 1\nrouted_scaling_factor: 1.0 # scaling factor for routing scores\nrouted_score_func: """" # scoring function for routing\nrouted_bias: False # a flag if a bias term is added for routing\nn_routing_groups: -1 # number of groups for routing, disabled by default\ntopk_routing_group: -1 # number of top groups to route inputs. For EP,\n# sending activations to a maximum of topk_routing_group distinct devices can yield performance benefits.\n\n# For complex architectures like llama4 there are repeated sets of\n# inhomogeneous layers. E.g. maverick uses [dense+rope, moe+rope, dense+rope, moe+nope]\n# which can only be scanned together in one large block of inhomogeneous_layer_cycle_interval=4 layers.\ninhomogeneous_layer_cycle_interval: 1\n\n# pipeline parallelism\n# The number of decoder layers is equal to the product of num_stages, num_layers_per_pipeline_stage and num_pipeline_repeats.\n# There is a tradeoff between the num_layers_per_pipeline_stage and num_pipeline_repeats: The more layers per stage the easier\n# it is to hide the pipeline communication behind the compute since there is more compute per stage, however there will be a larger bubble\n# since there are fewer repeats. Similarly, there is tradeoff for num_pipeline_microbatches - more microbatches leads to a smaller bubble,\n# but a smaller size per microbatch which may hurt per-stage performance. Additionally, note when microbatches > num_stages we have the opportunity to\n# perform the circular transfer (last stage to first) asynchronously.\n# The bubble fraction is (num_stages - 1) / (num_pipeline_repeats * num_pipeline_microbatches + num_stages - 1)\nnum_layers_per_pipeline_stage: 1\n# The number of repeats will be set to num_decoder_layers / (num_pipeline_stages * num_layers_per_pipeline_stage)\nnum_pipeline_repeats: -1\npipeline_parallel_layers: -1 # Pipeline only this number of layers - for the remaining layers the ""stage"" mesh axes will act like data parallelism.\n# This option helps when the number of layers does not have friendly divisors since SPMD pipelining requires that the\n# PP degree divides the number of layers.\n# By default (when set to -1) we pipeline all of the decoder layers.\n\n\n# num_pipeline_microbatches must be a multiple of the number of pipeline stages. By default it is set to the number of stages.\n# Note the microbatch_size is given by global_batch_size / num_pipeline_microbatches, where global_batch_size = per_device_batch_size * num_devices\nnum_pipeline_microbatches: -1\npipeline_delay_activation_forwarding: False # This delays the activation forwarding one loop iteration simplifying XLA's task of overlapping since\n# the communication and compute in each iteration are now independent. However this comes at the cost of doubling the pipeline bubble,\n# and you must set the number of microbatches to at least 2 * num_stages (the minimum 2 * num_stages is set by default with this delay).\n\nmodel_fsdp_ag_once: False # This controls whether the Zero-1 optimization is active.\n# This is a memory/time tradeoff - True: This is Zero-1 Sharding. Use ZeroOneTransformer to gather weights once per gradient step. \n# False: This is Zero-3 Sharing. Use the standard Transformer, which gathers for each microbatch's fwd/bwd pass.\npipeline_fsdp_ag_once: False # If set to true then all gather all of the weights over FSDP before the first pipeline iteration.\n# This is a memory/time tradeoff - we now have to store the FSDP gathered weights and gradients (typically in bf16), as opposed\n# to only one stage's worth, however we only execute one all-gather and reduce across per repeat, as opposed\n# to every microbatch. This is similar to zero-1 sharding, since we also don't need to all gather the FSDP weights in the backward pass.\n# An alternative to setting this to true may be to replace any FSDP with DP and use optimizer offloading if necessary.\n# A more optimal behavior is to all-gather at the start of each repeat, which would ideally get the best of both worlds -\n# a small amount of memory and time, however this has proven hard to implement in SPMD, see b/364386697 for more.\n\n# There are two loops for PP:\n# 1) Outer loop over microbatches (pipeline iterations)\n# 2) Inner loop over layers (layers per stage)\n# We have observed extra remat when a remat policy and scanning is performed on both, and recommend the default\n# settings below of scanning and setting a remat policy only over the pipeline iterations.\n# It may be useful to do the reverse when the layers_per_stage is very large.\n# The below settings only have effect when using pipeline parallelism.\nscan_pipeline_iterations: True\nscan_layers_per_stage: False\nset_remat_policy_on_pipeline_iterations: True\nset_remat_policy_on_layers_per_stage: False\n\n\n# Choose 'remat_policy' between 'minimal', 'save_dot_with_context_except_mlp', 'save_dot_except_mlpwi', 'save_dot_except_mlp',\n# 'save_qkv_proj', 'qkv_proj_offloaded', 'custom', 'minimal_offloaded', 'save_out_proj' and 'full'.\n# These options offer a trade-off between speed (fastest to slowest) and HBM usage (highest to lowest)\nremat_policy: 'full'\n# If ""custom"" remat_policy is chosen, you can select tensors from the following list to offload on host memory, rematerialize or save on device memory.\n# Pick one of these options for following tensors: ['remat','device','offload']\ndecoder_layer_input: 'device' # this tensor cannot be rematerialized - it serves as periodic checkpoints that act as the remat start points\ncontext: 'remat' # From https://github.com/NVIDIA/TransformerEngine/blob/main/transformer_engine/jax/attention.py#L581-L583\nmlpwi: 'remat'\nmlpwi_0: 'remat'\nmlpwi_1: 'remat'\nmlpwo: 'remat'\nquery_proj: 'remat'\nkey_proj: 'remat'\nvalue_proj: 'remat'\nqkv_proj: 'remat'\nout_proj: 'remat'\n\noptimizer_memory_host_offload: False\nparameter_memory_host_offload: False\nscan_layers: True # We recommend setting this to false when using pipeline parallelism, instead scanning the PP iterations.\nparam_scan_axis: 1\n\n# The attention parameter dictates the specific algorithm/methodology used to compute the attention scores\n# The attention_type parameter determines the variants of attention, e.g. global or local_sliding\nattention: 'autoselected' # Supported attention: autoselected, dot_product, flash, cudnn_flash_te\nattention_type: 'global' # Supported attention_type: global, local_sliding, chunk, mla\nsliding_window_size: 0\nchunk_attn_window_size: 0\nattn_logits_soft_cap: 0.0\nfinal_logits_soft_cap: 0.0\nuse_post_attn_norm: False\nuse_post_ffw_norm: False\nmla_naive_kvcache: True\n\n# MLA parameters\nq_lora_rank: 0\nkv_lora_rank: 512\nqk_nope_head_dim: 128\nqk_rope_head_dim: 64\nv_head_dim: 128\n\n# Combine matmuls for QKV and MLP\nfused_qkv: False\nfused_mlp: False\n\nrecord_internal_nn_metrics: 0\n\n# Output directory\n# Create a GCS bucket, e.g. my-maxtext-outputs and set this to ""gs://my-maxtext-outputs/""\nbase_output_directory: """"\n\n# Whether to enable emergency checkpoint. If True, `local_checkpoint_directory` and a non-zero `local_checkpoint_period` must also be specified.\n# Emergency checkpoint is an experimental Orbax feature that: periodically saves to persistent storage and, with a larger invertal, saves to a local directory.\n# During restore, if a local copy is available in any slice, it will be broadcast to other slices without having to fetch from persistent storage.\n# See more details on https://github.com/google/orbax/tree/main/checkpoint/orbax/checkpoint/experimental/emergency.\nenable_emergency_checkpoint: False\n\n# It should be specified when and only when `enable_emergency_checkpoint` is True.\nlocal_checkpoint_directory: """"\n\n# It should be a positive number when and only when `enable_emergency_checkpoint` is True.\nlocal_checkpoint_period: 0\n\n# Whether to use emergency checkpoint with the replicator service.\nuse_replicator_service: False\n\n# The interval to backup local checkpoints to the persistent storage.\nreplicator_backup_interval_minutes: 0\n\n# Jax cache directory\njax_cache_dir: ""~/jax_cache""\n\n# Hardware\nhardware: 'tpu' # Supported hardware types are 'tpu', 'gpu', 'gpu_multiprocess' and 'cpu'\n\n# Parallelism\nmesh_axes: ['data', 'stage', 'fsdp', 'fsdp_transpose', 'sequence', 'context', 'context_autoregressive', 'tensor', 'tensor_transpose', 'tensor_sequence', 'expert', 'autoregressive']\nlogical_axis_rules: [\n ['activation_batch', ['data', 'fsdp', 'fsdp_transpose', 'expert']],\n ['activation_batch_no_exp', ['data', 'fsdp', 'fsdp_transpose']],\n ['activation_embed_and_logits_batch', ['data', 'stage', 'fsdp', 'fsdp_transpose', 'expert']],\n ['activation_heads', ['tensor', 'tensor_transpose', 'sequence','tensor_sequence','autoregressive']],\n ['activation_kv_heads', ['tensor', 'tensor_transpose', 'sequence','tensor_sequence']],\n ['activation_length', ['sequence', 'context', 'expert']],\n ['activation_length', ['context', 'expert']],\n ['activation_length_no_exp', ['sequence', 'context']],\n ['activation_length_no_exp', ['context']],\n ['activation_norm_length', ['tensor_sequence', 'context', 'sequence']],\n ['activation_q_length', ['context', 'expert']],\n ['activation_q_length_no_exp', ['context']],\n ['prefill_activation_length', ['sequence', 'context']],\n ['prefill_activation_norm_length', ['tensor_sequence', 'context', 'sequence']],\n ['activation_kv_length', []],\n ['activation_embed', ['tensor', 'tensor_transpose']],\n ['activation_mlp', ['tensor', 'tensor_transpose', 'tensor_sequence']],\n ['activation_kv', ['tensor', 'tensor_transpose', 'tensor_sequence']],\n ['activation_prefill_kv_batch', ['data', 'fsdp', 'fsdp_transpose', 'expert']],\n ['activation_kv_batch', ['data', 'fsdp', 'fsdp_transpose', 'expert']],\n ['activation_kv_batch_no_exp', ['data', 'fsdp', 'fsdp_transpose']],\n ['activation_kv_head_dim', ['tensor', 'tensor_transpose', 'tensor_sequence']],\n ['activation_vocab', ['tensor', 'tensor_transpose', 'sequence', 'tensor_sequence']],\n ['activation_vocab', ['tensor', 'tensor_transpose']],\n ['activation_vocab', 'tensor_sequence'],\n ['activation_vocab', ['sequence','context']],\n ['activation_stage', 'stage'],\n ['activation_exp', ['expert']],\n ['decode_batch', ['data', 'fsdp', 'fsdp_transpose', 'expert']],\n ['decode_length', ['sequence']],\n ['mlp', ['fsdp_transpose', 'tensor', 'tensor_sequence', 'autoregressive']],\n ['vocab', ['tensor', 'tensor_transpose', 'tensor_sequence', 'autoregressive']],\n ['heads', ['tensor', 'tensor_transpose', 'tensor_sequence', 'autoregressive']],\n ['q_heads', ['tensor', 'tensor_transpose', 'tensor_sequence', 'autoregressive']],\n ['kv_heads', ['tensor', 'tensor_transpose', 'tensor_sequence', 'autoregressive']],\n ['embed', ['fsdp', 'fsdp_transpose', 'sequence', 'tensor_transpose', 'context', 'expert']],\n ['embed', ['fsdp', 'sequence', 'tensor_transpose', 'context' , 'expert']],\n ['embed', ['fsdp', 'fsdp_transpose', 'sequence', 'context', 'expert']],\n ['embed', ['fsdp', 'sequence', 'context', 'expert']],\n ['embed_no_exp', ['fsdp', 'fsdp_transpose', 'sequence', 'tensor_transpose', 'context']],\n ['embed_no_exp', ['fsdp', 'sequence', 'tensor_transpose', 'context']],\n ['embed_no_exp', ['fsdp', 'fsdp_transpose', 'sequence', 'context']],\n ['embed_no_exp', ['fsdp', 'sequence', 'context']],\n ['embed_tensor_transpose', ['tensor_transpose']], \n ['q_lora', ['fsdp', 'fsdp_transpose', 'sequence', 'context', 'tensor_transpose', 'expert']],\n ['q_lora', ['fsdp', 'sequence', 'context', 'tensor_transpose', 'expert']],\n ['q_lora', ['fsdp', 'fsdp_transpose', 'sequence', 'context', 'expert']],\n ['q_lora', ['fsdp', 'sequence', 'context', 'expert']],\n ['kv_lora', ['fsdp', 'fsdp_transpose', 'sequence', 'context', 'tensor_transpose', 'expert']],\n ['kv_lora', ['fsdp', 'sequence', 'context', 'tensor_transpose', 'expert']],\n ['kv_lora', ['fsdp', 'fsdp_transpose', 'sequence', 'context', 'expert']],\n ['kv_lora', ['fsdp', 'sequence', 'context', 'expert']],\n ['norm', ['tensor', 'tensor_transpose', 'tensor_sequence']],\n ['layers', 'stage'],\n ['kv', []],\n ['kv_head_dim', []],\n ['cache_batch_prefill', []],\n ['cache_batch', []],\n ['cache_heads_none', []],\n ['cache_heads', ['autoregressive', 'tensor', 'tensor_transpose', 'tensor_sequence']],\n ['cache_heads', ['autoregressive', 'tensor', 'tensor_sequence']],\n ['cache_kv', []],\n ['cache_sequence', []],\n ['exp', 'expert'],\n ['paged_kv_heads', ['tensor']],\n ['num_pages', []],\n ['tokens_per_page', []],\n ['paged_kv_head_dim_size', []],\n ]\n# Axes used for DCN must be earlier in this list than ICI, see (b/339009148) for details\ndata_sharding: [['data', 'stage', 'fsdp', 'fsdp_transpose', 'sequence', 'context', 'context_autoregressive', 'tensor', 'tensor_transpose', 'tensor_sequence', 'expert', 'autoregressive']]\ninput_data_sharding_logical_axes: ['activation_embed_and_logits_batch', 'activation_norm_length']\n\n# sharding tolerance: float between 0.0 and 1.0 representing the allowed percentage of non-sharded parameters.\nsharding_tolerance: 0.02\n\n# One axis for each parallelism type may hold a placeholder (-1)\n# value to auto-shard based on available slices and devices.\n# By default, product of the DCN axes should equal number of slices\n# and product of the ICI axes should equal number of devices per slice.\ndcn_data_parallelism: -1 # recommended DCN axis to be auto-sharded\ndcn_fsdp_parallelism: 1\ndcn_fsdp_transpose_parallelism: 1\ndcn_sequence_parallelism: 1 # never recommended\ndcn_context_parallelism: 1\ndcn_context_autoregressive_parallelism: 1\ndcn_tensor_parallelism: 1 # never recommended\ndcn_tensor_transpose_parallelism: 1\ndcn_tensor_sequence_parallelism: 1 # never recommended\ndcn_pipeline_parallelism: 1\ndcn_expert_parallelism: 1\ndcn_autoregressive_parallelism: 1 # never recommended\nici_data_parallelism: 1\nici_fsdp_parallelism: -1 # recommended ICI axis to be auto-sharded\nici_fsdp_transpose_parallelism: 1\nici_sequence_parallelism: 1\nici_context_parallelism: 1\nici_context_autoregressive_parallelism: 1\nici_tensor_parallelism: 1\nici_tensor_transpose_parallelism: 1\nici_tensor_sequence_parallelism: 1\nici_autoregressive_parallelism: 1\nici_pipeline_parallelism: 1\nici_expert_parallelism: 1\n\n# The number of TPU slices is automatically determined, you should not set this explicitly. For ahead of time compilation,\n# you should set compile_toplogy_num_slices, which will in turn set this value. For non-TPU environments this is set to 1.\nnum_slices: -1\n\n# Tokenizer\nvocab_size: 32_000 # powers of 2 for sharding\ntokenizer_path: ""assets/tokenizer.llama2""\n# tfds pipeline supports tokenizer_type: sentencepiece, huggingface, tiktoken\n# grain pipeline supports tokenizer_type: sentencepiece, huggingface\n# hf pipeline only supports huggingface type, and will ignore tokenizer_type flag\ntokenizer_type: ""sentencepiece"" # Currently supporting: ""tiktoken"", ""sentencepiece"", ""huggingface""\nuse_chat_template: False\ntokenize_train_data: True # False if the dataset is pre-tokenized\ntokenize_eval_data: True # False if the dataset is pre-tokenized\nadd_bos: True\nadd_eos: True\n\n# Dataset\nper_device_batch_size: 12.0\nexpansion_factor_real_data: -1 # if -1 then all hosts will load real data, else total_hosts//expansion_factor_real_data will pull data from GCS.\neval_per_device_batch_size: 0.0\nmax_corpus_chars: 10_000_000\ntrain_data_columns: ['text'] # for DPO dataset containing ""chosen"" and ""rejected""\ntrain_image_column: 'image'\neval_data_columns: ['text'] # for DPO dataset containing ""chosen"" and ""rejected""\neval_image_column: 'image'\npacking: True\nnum_epoch: 1 # only grain and tfds pipeline supports num_epoch > 1\n\n# direct preference optimization (DPO)\nuse_dpo: False\ndpo_label_smoothing: 0.0\ndpo_beta: 0.1\n\n# Supervised Fine-Tuning (SFT)\nuse_sft: False\n# sft_train_on_completion_only=False trains on both prompt and completion tokens; trains only on completion tokens otherwise\nsft_train_on_completion_only: False\n\n# dataset_type must be synthetic, hf, grain, tfds\n# details in: https://github.com/google/maxtext/blob/main/getting_started/Data_Input_Pipeline.md\ndataset_type: tfds\n# for TFDS input pipeline (dataset_type=tfds)\ndataset_path: """" # your path given as argument in download_dataset.sh, e.g. ""gs://my-maxtext-dataset/""\ndataset_name: 'c4/en:3.0.1'\neval_dataset_name: 'c4/en:3.0.1'\ntrain_split: 'train'\neval_split: 'validation'\n# for HuggingFace input pipeline (dataset_type=hf)\nhf_path: ''\nhf_data_dir: ''\nhf_train_files: ''\nhf_eval_split: ''\nhf_eval_files: ''\nhf_access_token: ''\n# for Grain input pipeline (dataset_type=grain)\n# Path to grain data files. Can be a single pattern or multiple patterns with weights.\n# For multiple patterns, use semicolon (;) to separate and colon (:) to specify weights.\n# Example: ""path/to/data1.array_record*:0.3;path/to/data2.array_record*:0.7""\n# Note: When using multiple files (separated by ';'), only ArrayRecord format is supported.\n# For more details, see https://github.com/google/maxtext/blob/main/getting_started/Data_Input_Pipeline.md#grain-input-pipeline\ngrain_train_files: ''\ngrain_eval_files: ''\ngrain_file_type: 'arrayrecord' # arrayrecord or parquet\ngrain_worker_count: 1\ngrain_worker_count_eval: 1\n# for using pathways\ncolocated_python_data_input: False # experimental feature, under testing\n\n# Training loop\nsteps: 150_001 # If set to -1 then will inherit value from learning_rate_schedule_steps\nlog_period: 100 # Flushes Tensorboard\n\njax_distributed_initialization_timeout: 300 # This is the default timeout in https://github.com/jax-ml/jax/blob/main/jax/_src/distributed.py\n# Note there are two separate initializations - the jax coordination service (aka jax.distributed.initialize) and the backend (e.g. PjRT), the timeout above refers\n# only to the jax coordination service.\njax_debug_log_modules: """" # Set this to ""jax"" to enable jax verbose logging such as for the jax coordination service initialization.\nskip_jax_distributed_system: False # If True we will not initialize the jax distributed system.\n# Currently the jax distributed is needed on cloud TPUs for async checkpointing.\n# However when run on google internal TPUs the coordination service is started automatically\n# and we should set this to True so we won't try to initialize a second time manually.\n\n# We take inspiration from Llama2's learning rate (LR) schedule, see https://arxiv.org/pdf/2307.09288.pdf section 2.2\n# Learning rate schedule has either two or three parts:\n# 1) Linear warmup from 0 to [learning_rate] over steps 0 to [learning_rate_schedule_steps * warmup_steps_fraction]\n# 2) Cosine decay from [learning_rate] to [learning_rate * cosine_learning_rate_final_fraction] from warmup to learning_rate_schedule_steps\n# 3) Constant learning rate of 0 from learning_rate_schedule_steps to steps.\n# The zero learning rate section can be used to more accurately measure the fully trained model's performance.\nlearning_rate: 3.e-5\ncosine_learning_rate_final_fraction: 0.1\nwarmup_steps_fraction: 0.1\nlearning_rate_schedule_steps: -1 # By default the length of the schedule is set to the number of steps.\n# However you may choose a longer schedule (learning_rate_schedule_steps > steps), in which case the training will end before\n# dropping fully down. Or you may choose a shorter schedule, where the unspecified steps will have a learning rate of 0.\n\nmax_target_length: 2048 # Maximum sequence length\nmax_prefill_predict_length: 64 # Maximum length for the prefill when doing autoregression\nprompt: ""I love to"" # Prompt for language model sampling.\nload_from_prefill_dir: False # If true, decode.py doesn't ""prefill"" but just reads from directory\nprefill_cache_dir: """" # If set and load_from_prefill_dir, decode.py reads from directory. If set, decode.py writes to directory\nautoregressive_decode_assert: """"\n\n# For nsys profiler, pass the training command to nsys command\n# e.g. nsys profile -s none --force-overwrite true --capture-range=cudaProfilerApi --capture-range-end=stop {training command}\nprofiler: """" # Supported profiler: '', xplane, nsys\n# If set to true, upload all profiler results from all hosts. Otherwise, only upload the profiler result from the first host.\nupload_all_profiler_results: False\n# Skip first n steps for profiling, to omit things like compilation and to give\n# the iteration time a chance to stabilize.\nskip_first_n_steps_for_profiler: 1\n# Profile for a small number of steps to avoid a large profile file size.\nprofiler_steps: 5\nprofile_cleanly: True # If set to true, adds a block_until_ready on train state which aligns the profile for each step.\nprofile_periodically_period: -1 # If set to a positive integer, profile every profile_periodically_period steps.\n# This is useful to debug scenarios where performance is changing.\n\n\n# Dump HLO options\ndump_hlo: False\ndump_step: -1 # Dump modules at the given step if set to a positive integer.\ndump_hlo_local_dir: ""/tmp/xla_dump/""\ndump_hlo_delete_local_after: True # Cleans local directory after its uploaded\ndump_hlo_gcs_dir: """" # Defaults to {base_output_directory}/{run_name}/xla_dump\ndump_hlo_local_module_name: ""jit_train_step"" # Filter saving modules locally by this string. Set to empty string to remove any filter.\ndump_hlo_module_name: ""jit_train_step"" # Filter uploading modules by this string. Set to empty string to remove any filter.\ndump_hlo_xla_flags: """" # Defaults to ""--xla_dump_to={dump_hlo_local_dir} --xla_dump_hlo_module_re={dump_hlo_local_module_name} --xla_dump_large_constants""\ndump_hlo_upload_all: False # If true all hosts dump HLO, false only jax.process_index()==0\n# All hosts should have identical HLO for SPMD programs, however we have encountered some bugs\n# where this is not the case and it is helpful to compare HLO across hosts.\n\n# When dropout is false the model is a deterministic function of the\n# data_shuffle_seed and init_weights_seed (i.e. reproducible losses)\nenable_dropout: True\nenable_data_shuffling: True\ndata_shuffle_seed: 0\ninit_weights_seed: 0\n\n# You may disable clipping by setting gradient_clipping_threshold to zero.\ngradient_clipping_threshold: 1.0\n\n# Instead of updating the weights every step, you may effectively use a larger\n# batch by accumulating the gradient over a set of steps.\ngradient_accumulation_steps: 1\n\nopt_type: ""adamw"" # one of ""adamw"", ""adam_pax"" or ""sgd""\n\n# AdamW optimizer parameters\n# We use AdamW following Llama2's training details, see https://arxiv.org/pdf/2307.09288.pdf section 2.2\nadam_b1: 0.9 # Exponential decay rate to track the first moment of past gradients.\nadam_b2: 0.95 # Exponential decay rate to track the second moment of past gradients.\nadam_eps: 1.e-8 # A small constant applied to denominator outside of the square root.\nadam_eps_root: 0. # A small constant applied to denominator inside the square root.\nadam_weight_decay: 0.1 # AdamW Weight decay\nmu_dtype: """" # data type to store ""mu"" of AdamW tracking the first moment. Inherits from weight_dtype if unset.\n# Setting nu_dtype is not yet supported by optax, instead nu_dtype is always inherited from weights.\n# See b/399961932 for more.\n\n# Stack trace parameters\ncollect_stack_trace: False\nstack_trace_to_cloud: False # Uploads to cloud logging if True, else to the console if False.\nstack_trace_interval_seconds: 600 # Stack trace collection frequency in seconds.\n\n# Use iota operator in Embed\nuse_iota_embed: False\n# use positional embedding\nuse_untrainable_positional_embedding: False\ntrainable_position_size: -1 # enable gpt3 position embedding with a positive trainable_position_size\n# RoPE parameters\nrope_type: ""default"" # one of ""default"", ""llama3.1"" or ""yarn""\nrope_use_scale: True # apply rope scaling for llama3.1 (see class `LLaMARotaryEmbedding` for more)\nrope_min_timescale: 1\nrope_max_timescale: 10_000 # Timescale For global Attention\nlocal_rope_max_timescale: -1 # If positive used for local window Attention, otherwise `rope_max_timescale` is used for both local and global\n\n# yarn RoPE parameters\nmax_position_embeddings: 163840\noriginal_max_position_embeddings: 4096\nrope_factor: 40\nbeta_fast: 32\nbeta_slow: 1\nmscale: 1.0\n\n# Ahead of time Compilation (aka AOT)\n# Only set these arguments if you are running train_compile or loading a compiled train step.\ncompiled_trainstep_file: """" # Name of saved serialized compiled train_step, e.g. compiled_train_v5e-256.pickle\ncompile_topology: '' # Target hardware version, e.g. 'v5e-256'\ncompile_topology_num_slices: -1 # Number of target slices, set to a positive integer.\n\ndecode_sampling_strategy: ""greedy"" # decode_sampling_strategy should be one of greedy, weighted, nucleus, or topk\ndecode_sampling_nucleus_p: -1 # set if you're doing nucleus / top-p\ndecode_sampling_top_k: 0 # set if you're doing top-k\ndecode_sampling_temperature: 1.\n\neval_interval: -1 # the specific number of train step between eval_step\neval_steps: -1 # run this number of steps for eval, recommend setting this to prevent error due to running out of evel data\ntarget_eval_loss: 0. # early stop once reaching target eval_loss\n\n# Goodput parameters\nenable_goodput_recording: False\nmonitor_goodput: False\ngoodput_upload_interval_seconds: 30\nenable_pathways_goodput: False\nmonitor_step_time_deviation: True\nstep_deviation_interval_seconds: 30\nenable_gcp_goodput_metrics: True\nenable_gcp_step_deviation_metrics: True\n\n# GCP workload monitoring\nreport_heartbeat_metric_for_gcp_monitoring: False\nheartbeat_reporting_interval_in_seconds: 5\nreport_performance_metric_for_gcp_monitoring: False\n\nenable_tensorboard: True\n\n# Vertex AI Tensorboard Configurations - https://github.com/google/maxtext/tree/main/getting_started/Use_Vertex_AI_Tensorboard.md\n# Set to True for GCE, False if running via XPK\nuse_vertex_tensorboard: False\n# Project to create Vertex AI Tensorboard in for GCE, blank if project is set using 'gcloud config set project'\n# Set this to blank if running via XPK\nvertex_tensorboard_project: """"\n# Region to create Vertex AI Tensorboard in for GCE, blank if running via XPK\n# Vertex AI supported regions: https://cloud.google.com/vertex-ai/docs/general/locations#available-regions\nvertex_tensorboard_region: """"\n\n# If set to True, MaxText will perform extra checks using jax.checkify. Note that this will effect performance.\nmax_checkify: False\n\n# Inference\ninference_microbenchmark_prefill_lengths: ""64,128,256,512,1024""\ninference_microbenchmark_stages: ""prefill,generate""\ninference_microbenchmark_loop_iters: 10\ninference_microbenchmark_log_file_path: """"\ninference_microbenchmark_num_samples: [1, 2, 3, 4, 5]\ninference_metadata_file: """" # path to a json file\ninference_server: ""MaxtextInterleavedServer"" # inference server to start\nprefill_slice: ""v5e-16"" # slice to use for prefill in disaggregation mode\ngenerate_slice: ""v5e-16"" # slice to use for generatation in disaggregation mode\ninference_benchmark_test: False\nenable_model_warmup: False\nenable_llm_inference_pool: False # Bool to launch inference server for llm_inference_gateway with their specified APIs\nmulti_sampling: False\nreturn_log_prob: False\n\n# Stack prefill cache across the layer to reduce the\n# Python layer latency.\nstack_prefill_result_cache: False\n\n# KV Cache layout control\n# Logical layout: 0,1,2,3 ; CACHE_BATCH, CACHE_SEQUENCE, CACHE_HEADS, CACHE_KV\n# Default layout: 1,2,0,3 ; CACHE_SEQUENCE, CACHE_HEADS, CACHE_BATCH, CACHE_KV\nprefill_cache_axis_order: ""1,2,0,3""\nar_cache_axis_order: ""1,2,0,3""\n\n# Compute layout control\n# Default layout: 0,1,2,3 ; BATCH, LENGTH, HEAD, D_KV\n# Currently only support compute layout: 0,1,2,3 and 0,2,1,3\ncompute_axis_order: ""0,1,2,3""\n\nreshape_q: False\n\n# Maxengine Metrics\nprometheus_port: 0\n\n# Maxengine server\nenable_jax_profiler: False\njax_profiler_port: 9999\n\nlog_config: True # Prints the config (after defaults have been set by pyconfig logic)\n\n# Checkpoint Structured logging\nenable_checkpoint_cloud_logger: False\n\n# Single-controller\nenable_single_controller: False\n\ncustom_mesh: """" # Available options: ['hybrid_ring_64x4', 'hybrid_ring_32x8']\n# Split physical axes for https://jax.readthedocs.io/en/latest/_autosummary/jax.experimental.mesh_utils.create_device_mesh.html\nallow_split_physical_axes: False\n# Apply transformations to the mesh to optimize for TPU v6e\noptimize_mesh_for_tpu_v6e: False\n\nshardy: True # Whether to use shardy XLA backend (default in Jax starting 0.7.0), or GSPMD (to be fully deprecated ~2026)\n\nuse_ragged_attention: False\nragged_block_size: 256\n\n### Splash attention block sizes\n# These can be tuned for specific hardware generations, and can be set up to\n# the model's sequence length.\nsa_block_q: 512\nsa_block_kv: 512\nsa_block_kv_compute: 512\nsa_block_q_dkv: 512\nsa_block_kv_dkv: 512\nsa_block_kv_dkv_compute: 512\nsa_block_q_dq: 512\nsa_block_kv_dq: 512\nsa_use_fused_bwd_kernel: False\nsa_q_layout: ""HEAD_DIM_MINOR""\nsa_k_layout: ""HEAD_DIM_MINOR""\nsa_v_layout: ""HEAD_DIM_MINOR""\n\n### Determine if we want to use load balance for context parallelism\ncontext_parallel_load_balance: True\n\n### Paged Attention ###\n# These settings take effect only when `attention=paged`.\n# They should be adjusted based on the available HBM and model config.\n# Note: one page group corresponds to one request/slot\npagedattn_num_pages: 64 # total number of pages to allocate\npagedattn_tokens_per_page: 32 # number of tokens each page can hold\npagedattn_pages_per_compute_block: 4 # number of pages processed together in pallas kernels\npagedattn_max_pages_per_group: -1 # defaults to number of pages needed to reach max_target_length\n# Alignment of head_dim to the nearest multiple of this value, set to 0 to disable alignment. On\n# TPUs, the head_dim is padded to the nearest multiple of 128.\npagedattn_head_dim_alignment: 128\n\n\n# Chunked Prefill Parameters\nprefill_chunk_size: 256\nuse_chunked_prefill: False\n\n# Prefix Caching parameters in jetstream\nenable_prefix_caching: False\nprefix_caching_hbm_byte: 10_000_000_000 # 10 GB\nprefix_caching_dram_byte: 100_000_000_000 # 100 GB\n\n# This is a temporary flag that will be removed soon after the fix lands in TE\nenable_padding_causal_mask: True\n\n# Llama4-specific\n# Whether to apply Query/Key normalization.\n# NOTE: non-Llama4 models use RMSNorm before RoPE\n# whereas Llama4 models use L2Norm after RoPE\nuse_qk_norm: False\n# Every `X` layers will NOT use RoPE\nnope_layer_interval: -1\n# Every `X` layers is MoE layer\ninterleave_moe_layer_step: 1\n# dynamically scale the attention temperature for each query token based on sequence length\n# Recommended for long sequences (e.g., >32k tokens) to maintain stable output results\n# See (https://arxiv.org/abs/2501.19399) for more details\ntemperature_tuning: False\n\n# Multimodal flags\nuse_multimodal: False\nfreeze_vision_encoder_params: True\ndtype_mm: ""float32"" # Data type for multimodal model's vision encoder\nremat_policy_for_vit: ""minimal"" # Remat policy for multimodal model's vision encoder. Check `remat_policy` for options.\nimage_size_for_vit: 896 # Default for Gemma3, and should be overwritten by model's config\nimage_path: """" # Local image path used for decoding\nimage_placeholder: ""<|image|>""\n\n### llama4 multi modal configs\nhidden_size_for_vit: 1408\nintermediate_size_for_vit: 5632\nnum_attention_heads_for_vit: 16\nnum_channels_for_vit: 3\ntile_size_for_vit: 336\npatch_size_for_vit: 14\nnum_hidden_layers_for_vit: 34\nprojector_input_dim_for_vit: 4096\nprojector_output_dim_for_vit: 4096\nrope_theta_for_vit: 10000\nvision_output_dim_for_vit: 4096\npixel_shuffle_ratio_for_vit: 0.5\nprojector_dropout_for_vit: 0.0\n\n# Subslice shape in the form of ""x,y,z"" when using pathways (single controller). \n# Example: ""8,8"" to use a 8x8 subgrid (64 chips) of a full pod (16x16) of trillium.\nsubslice_shape: """"\n",yaml,tab
|
| 11 |
+
11,344875,"MaxText/configs/base.yml",7278,400,"dropout_rate: 0.0\nlogits_via_embedding: False\nnormalize_embedding_logits: True # whether to normalize pre-softmax logits if logits_via_embedding is true\nlogits_dot_in_fp32: False # whether to use fp32 in logits_dense or shared_embedding dot product for stability\ncast_logits_to_fp32: True # whether to cast the logits to fp32. The higher precision is generally beneficial, but it can vary slightly.",yaml,selection_command
|
| 12 |
+
12,347767,"MaxText/configs/base.yml",7492,0,"",yaml,selection_mouse
|
| 13 |
+
13,348021,"MaxText/configs/base.yml",7484,12,"logits_dense",yaml,selection_mouse
|
| 14 |
+
14,348162,"MaxText/configs/base.yml",7432,111,"logits_dot_in_fp32: False # whether to use fp32 in logits_dense or shared_embedding dot product for stability\n",yaml,selection_mouse
|
| 15 |
+
15,350453,"MaxText/configs/base.yml",7492,0,"",yaml,selection_mouse
|
| 16 |
+
16,350533,"MaxText/configs/base.yml",7484,12,"logits_dense",yaml,selection_mouse
|
| 17 |
+
17,350680,"MaxText/configs/base.yml",7432,111,"logits_dot_in_fp32: False # whether to use fp32 in logits_dense or shared_embedding dot product for stability\n",yaml,selection_mouse
|
| 18 |
+
18,351817,"MaxText/configs/base.yml",7507,0,"",yaml,selection_mouse
|
| 19 |
+
19,351894,"MaxText/configs/base.yml",7500,16,"shared_embedding",yaml,selection_mouse
|
| 20 |
+
20,352015,"MaxText/configs/base.yml",7432,111,"logits_dot_in_fp32: False # whether to use fp32 in logits_dense or shared_embedding dot product for stability\n",yaml,selection_mouse
|
| 21 |
+
21,352517,"MaxText/configs/base.yml",7519,0,"",yaml,selection_mouse
|
4de8d861ed2563988d5f1871647ebc5fe70861b32d24a4b32f9363518653a328/crowd-code-a5086ce0-ac41-43bb-a6fb-49a8583a615b1764420516110-2025_11_29-13.48.42.516/source.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
4de8d861ed2563988d5f1871647ebc5fe70861b32d24a4b32f9363518653a328/crowd-code-b3271939-bd4f-497b-b876-5ea890ece75f1750632226677-2025_06_22-15.43.48.822/source.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
4de8d861ed2563988d5f1871647ebc5fe70861b32d24a4b32f9363518653a328/crowd-code-c2840635-8d0b-4216-81fb-6d4064dd7cdb1758711807594-2025_09_24-13.03.29.991/source.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
4de8d861ed2563988d5f1871647ebc5fe70861b32d24a4b32f9363518653a328/crowd-code-d5ea407a-1dd6-4c7b-a9d1-ca57a06418971766657101852-2025_12_25-10.05.09.154/source.csv
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Sequence,Time,File,RangeOffset,RangeLength,Text,Language,Type
|
| 2 |
+
1,2,"Franz_Srambical_CV.tex",0,0,"% resume.tex\n% vim:set ft=tex spell:\n\n\documentclass[10pt,letterpaper]{article}\n\usepackage{graphicx}\n\usepackage[ngerman]{babel}\n\usepackage[autostyle=true,german=quotes]{csquotes}\n\usepackage{tikz}\n\usepackage[letterpaper,margin=0.75in]{geometry}\n\usepackage[utf8]{inputenc}\n\usepackage{mdwlist}\n\usepackage[T1]{fontenc}\n\usepackage{textcomp}\n\usepackage{tgpagella}\n\usepackage{hyperref}\n\pagestyle{empty}\n\setlength{\tabcolsep}{0em}\n\n% indentsection style, used for sections that aren't already in lists\n% that need indentation to the level of all text in the document\n\newenvironment{indentsection}[1]%\n{\begin{list}{}%\n\t{\setlength{\leftmargin}{#1}}%\n\t\item[]%\n}\n{\end{list}}\n\n\newcommand{\quotes}[1]{``#1''}\n% opposite of above; bump a section back toward the left margin\n\newenvironment{unindentsection}[1]%\n{\begin{list}{}%\n\t{\setlength{\leftmargin}{-0.5#1}}%\n\t\item[]%\n}\n{\end{list}}\n\n% format two pieces of text, one left aligned and one right aligned\n\newcommand{\headerrow}[2]\n{\begin{tabular*}{\linewidth}{l@{\extracolsep{\fill}}r}\n\t#1 &\n\t#2 \\\n\end{tabular*}}\n\n% make ""C++"" look pretty when used in text by touching up the plus signs\n\newcommand{\CPP}\n{C\nolinebreak[4]\hspace{-.05em}\raisebox{.22ex}{\footnotesize\bf ++}}\n\n% and the actual content starts here\n\begin{document}\n\fboxsep=0mm%padding thickness\n\fboxrule=1pt%border thickness\n\begin{tikzpicture}[remember picture, overlay]\n \node [anchor=north east, inner sep=55] at (current page.north east)\n {\fbox{\includegraphics[height=3cm]{Franz_Srambical-Foto}}};\n\end{tikzpicture}\n\n{\LARGE \textbf{Franz Srambical}}\n\n\vspace{2em}\nVolkartstraße 43 \ \ \textbullet\n\ \ 80636 Munich, Germany\\n\n+43 699 171 82 739\ \ \textbullet\n\ \ franz.srambical@gmail.com\n\n\textbullet \ \ \url{https://github.com/emergenz} \ \ \textbullet\n\n\n%\smash{\includegraphics[height=3cm]{Franz_Srambical-Foto}}\n\n\vspace{2em}\n\n\hrule\n\vspace{-0.4em}\n\n\subsection*{Experience}\n\n\begin{itemize}\n\t\parskip=0.1em\n\n\t\item\n\t\headerrow\n\t\t{\href{https://pdoom.org/}{\textbf{p(doom)}}}\n\t\t{\textbf{01. 10. 2023 - today}}\n\t\\\n\t\headerrow\n\t\t{\emph{Co-Founder and Researcher}}\n\t\t{\emph{}}\n\t\begin{itemize*}\n \item \href{https://pdoom.org/jasmine.html}{Jasmine}: A simple, performant and scalable JAX-based world modeling codebase\n \item \href{https://pdoom.org/crowd_code.html}{crowd-code}: Crowd-sourcing a dataset to make agents code like humans\n \item \href{https://pdoom.org/agi_cast.html}{AGI-CAST}: Continually growing screen recordings of long-horizon AGI research\n \item \href{https://huggingface.co/datasets/p-doom/common-craft}{common-craft}: Five thousand hours of real-world Minecraft gameplay\n \item Contributions to JAX, MaxText, Flax, Grain, Chex, RLax, xprof (Deepmind), NeMo (Nvidia), VeRL (ByteDance), SGLang, miles (LMSYS), OpenInstruct (AllenAI),...\n\t\end{itemize*}\n\n\t\item\n\t\headerrow\n\t\t{\href{https://www.joinef.com/}{\textbf{Entrepreneur First}}}\n\t\t{\textbf{01. 09. 2024 - 14. 12. 2024}}\n\t\\\n\t\headerrow\n\t\t{\emph{Resident}}\n\t\t{\emph{}}\n\t\begin{itemize*}\n \item Part of \href{https://en.wikipedia.org/wiki/Matt_Clifford}{Matt Clifford's} only-ever personal cohort\n\t\end{itemize*}\n\n\t\item\n\t\headerrow\n\t\t{\textbf{\href{https://www.livetheresidency.com/}{The Residency}}}\n\t\t{\textbf{01. 09. 2024 - 31. 12. 2024}}\n\t\\\n\t\headerrow\n\t\t{\emph{Resident}}\n\t\t{\emph{}}\n\t\begin{itemize*}\n \item Startup incubator backed by Sam Altman and Tyler Cohen\n\t\end{itemize*}\n\n\t\item\n\t\headerrow\n\t\t{\textbf{Helmholtz Munich}}\n\t\t{\textbf{01. 07. 2023 - today}}\n\t\\\n\t\headerrow\n\t\t{\emph{Research Assistant}}\n\t\t{\emph{}}\n\t\begin{itemize*}\n \item Stefan Bauer's lab\n \item Bastian Rieck's lab\n\t\end{itemize*}\n\n\t\item\n\t\headerrow\n\t\t{\textbf{Celonis}}\n\t\t{\textbf{01. 09. 2022 - today}}\n\t\\\n\t\headerrow\n\t\t{\emph{Distributed Systems Software Engineer - Core Mining Engine}}\n\t\t{\emph{}}\n\t\begin{itemize*}\n \item Large-scale Data Processing, Distributed Systems\n\t\end{itemize*}\n\n\t\item\n\t\headerrow\n\t\t{\textbf{Accso}}\n\t\t{\textbf{15. 04. 2022 - 31. 08. 2022}}\n\t\\\n\t\headerrow\n\t\t{\emph{Software Engineer}}\n\t\t{\emph{}}\n\t\begin{itemize*}\n \item Clojure, Python, Svelte, Vue.js, Spring, PostgreSQL\n\t\end{itemize*}\n\end{itemize}\n\n\hrule\n\vspace{-0.4em}\n\n\subsection*{Education}\n\n\begin{itemize}\n\t\parskip=0.1em\n\n\t\item\n\t\headerrow\n\t\t{\textbf{Technical University of Munich}}\n\t\t{\textbf{2023 - today}}\n\t\\\n\t\headerrow\n\t\t{\emph{M. Sc. Computer Science}}\n\t\t{\emph{}}\n\t\begin{itemize*}\n \item M. Sc. Computer Science at TUM, on sabbatical leave to work on p(doom)\n\t\end{itemize*}\n\n\t\item\n\t\headerrow\n\t\t{\textbf{Technical University of Munich/ Ludwig-Maximilian-University of Munich}}\n\t\t{\textbf{2020 - 2023}}\n\t\\\n\t\headerrow\n\t\t{\emph{B. Sc. Computer Science with Computational Neuroscience Minor}}\n\t\t{\emph{}}\n\t\begin{itemize*}\n \item B. Sc. Computer Science at TUM\n \item Courses of M. Sc. Computational Neuroscience at LMU (21 Credits)\n\t\end{itemize*}\n\n\t\item\n\t\headerrow\n\t\t{\textbf{De La Salle Strebersdorf, Vienna}}\n\t\t{\textbf{2012 - 2020}}\n\t\\\n\t\headerrow\n\t\t{\emph{Grade: 1,0/1,0}}\n\t\t{\emph{}}\n\end{itemize}\n\n\hrule\n\vspace{-0.4em}\n\n\end{document}\n\n%%% Local Variables:\n%%% mode: latex\n%%% TeX-master: t\n%%% End:\n",latex,tab
|
| 3 |
+
2,68,"extension-output-pdoom-org.crowd-code-#1-crowd-code",0,0,"10:05:09 AM [info] Activating crowd-code\n10:05:09 AM [info] Recording started\n10:05:09 AM [info] Initializing git provider using file system watchers...\n10:05:09 AM [error] Not a git repository: EntryNotFound (FileSystemError): Error: ENOENT: no such file or directory, stat '/Users/franzsrambical/Documents/lebenslauf/.git'\n",Log,tab
|
| 4 |
+
3,3022,"extension-output-pdoom-org.crowd-code-#1-crowd-code",325,0,"10:05:12 AM [info] Retrying git provider initialization...\n",Log,content
|
| 5 |
+
4,3048,"extension-output-pdoom-org.crowd-code-#1-crowd-code",384,0,"10:05:12 AM [error] Not a git repository: EntryNotFound (FileSystemError): Error: ENOENT: no such file or directory, stat '/Users/franzsrambical/Documents/lebenslauf/.git'\n",Log,content
|
| 6 |
+
5,4008,"Franz_Srambical_CV.tex",0,0,"",latex,tab
|
| 7 |
+
6,20642,"Franz_Srambical_CV.tex",2111,0,"",latex,selection_mouse
|
| 8 |
+
7,20650,"Franz_Srambical_CV.tex",2110,0,"",latex,selection_command
|
| 9 |
+
8,22488,"Franz_Srambical_CV.tex",3508,0,"",latex,selection_command
|
| 10 |
+
9,23484,"Franz_Srambical_CV.tex",3734,0,"",latex,selection_command
|
| 11 |
+
10,64158,"Franz_Srambical_CV.tex",3734,5,"",latex,content
|
| 12 |
+
11,65108,"Franz_Srambical_CV.tex",3734,0,"0",latex,content
|
| 13 |
+
12,65110,"Franz_Srambical_CV.tex",3735,0,"",latex,selection_keyboard
|
| 14 |
+
13,65222,"Franz_Srambical_CV.tex",3735,0,"1",latex,content
|
| 15 |
+
14,65224,"Franz_Srambical_CV.tex",3736,0,"",latex,selection_keyboard
|
| 16 |
+
15,66240,"Franz_Srambical_CV.tex",3735,1,"",latex,content
|
| 17 |
+
16,66463,"Franz_Srambical_CV.tex",3734,1,"",latex,content
|
| 18 |
+
17,66735,"Franz_Srambical_CV.tex",3734,0,"1",latex,content
|
| 19 |
+
18,66736,"Franz_Srambical_CV.tex",3735,0,"",latex,selection_keyboard
|
| 20 |
+
19,66739,"Franz_Srambical_CV.tex",3735,0,"3",latex,content
|
| 21 |
+
20,66739,"Franz_Srambical_CV.tex",3736,0,"",latex,selection_keyboard
|
| 22 |
+
21,67092,"Franz_Srambical_CV.tex",3736,0,".",latex,content
|
| 23 |
+
22,67095,"Franz_Srambical_CV.tex",3737,0,"",latex,selection_keyboard
|
| 24 |
+
23,67557,"Franz_Srambical_CV.tex",3736,1,"",latex,content
|
| 25 |
+
24,67720,"Franz_Srambical_CV.tex",3735,1,"",latex,content
|
| 26 |
+
25,67876,"Franz_Srambical_CV.tex",3734,1,"",latex,content
|
| 27 |
+
26,68219,"Franz_Srambical_CV.tex",3734,0,"3",latex,content
|
| 28 |
+
27,68220,"Franz_Srambical_CV.tex",3735,0,"",latex,selection_keyboard
|
| 29 |
+
28,68223,"Franz_Srambical_CV.tex",3735,0,"1",latex,content
|
| 30 |
+
29,68224,"Franz_Srambical_CV.tex",3736,0,"",latex,selection_keyboard
|
| 31 |
+
30,68601,"Franz_Srambical_CV.tex",3736,0,".",latex,content
|
| 32 |
+
31,68602,"Franz_Srambical_CV.tex",3737,0,"",latex,selection_keyboard
|
| 33 |
+
32,68736,"Franz_Srambical_CV.tex",3737,0," ",latex,content
|
| 34 |
+
33,68739,"Franz_Srambical_CV.tex",3738,0,"",latex,selection_keyboard
|
| 35 |
+
34,69238,"Franz_Srambical_CV.tex",3738,0,"0",latex,content
|
| 36 |
+
35,69245,"Franz_Srambical_CV.tex",3739,0,"",latex,selection_keyboard
|
| 37 |
+
36,69303,"Franz_Srambical_CV.tex",3739,0,"5",latex,content
|
| 38 |
+
37,69310,"Franz_Srambical_CV.tex",3740,0,"",latex,selection_keyboard
|
| 39 |
+
38,69939,"Franz_Srambical_CV.tex",3740,0,".",latex,content
|
| 40 |
+
39,69945,"Franz_Srambical_CV.tex",3741,0,"",latex,selection_keyboard
|
| 41 |
+
40,70122,"Franz_Srambical_CV.tex",3741,0," ",latex,content
|
| 42 |
+
41,70125,"Franz_Srambical_CV.tex",3742,0,"",latex,selection_keyboard
|
| 43 |
+
42,70408,"Franz_Srambical_CV.tex",3742,0,"2",latex,content
|
| 44 |
+
43,70412,"Franz_Srambical_CV.tex",3743,0,"",latex,selection_keyboard
|
| 45 |
+
44,70470,"Franz_Srambical_CV.tex",3743,0,"0",latex,content
|
| 46 |
+
45,70473,"Franz_Srambical_CV.tex",3744,0,"",latex,selection_keyboard
|
| 47 |
+
46,70568,"Franz_Srambical_CV.tex",3744,0,"2",latex,content
|
| 48 |
+
47,70571,"Franz_Srambical_CV.tex",3745,0,"",latex,selection_keyboard
|
| 49 |
+
48,70820,"Franz_Srambical_CV.tex",3745,0,"2",latex,content
|
| 50 |
+
49,70822,"Franz_Srambical_CV.tex",3746,0,"",latex,selection_keyboard
|
| 51 |
+
50,74705,"Franz_Srambical_CV.tex",3745,1,"",latex,content
|
| 52 |
+
51,75002,"Franz_Srambical_CV.tex",3745,0,"3",latex,content
|
| 53 |
+
52,75004,"Franz_Srambical_CV.tex",3746,0,"",latex,selection_keyboard
|
| 54 |
+
53,75455,"Franz_Srambical_CV.tex",3745,0,"",latex,selection_command
|
| 55 |
+
54,80545,"Franz_Srambical_CV.tex",3706,0,"",latex,selection_command
|
| 56 |
+
55,81084,"Franz_Srambical_CV.tex",3685,0,"",latex,selection_command
|
| 57 |
+
56,81234,"Franz_Srambical_CV.tex",3673,0,"",latex,selection_command
|
| 58 |
+
57,81372,"Franz_Srambical_CV.tex",3667,0,"",latex,selection_command
|
| 59 |
+
58,83281,"extension-output-pdoom-org.crowd-code-#1-crowd-code",0,0,"",Log,tab
|
| 60 |
+
59,84596,"TERMINAL",0,0,"",,terminal_focus
|
| 61 |
+
60,84600,"Franz_Srambical_CV.tex",0,0,"",latex,tab
|
| 62 |
+
61,89631,"TERMINAL",0,0,"pdflatex Franz_Srambical_CV.tex",,terminal_command
|
| 63 |
+
62,89682,"TERMINAL",0,0,"]633;C",,terminal_output
|
| 64 |
+
63,91027,"TERMINAL",0,0,"This is pdfTeX, Version 3.141592653-2.6-1.40.27 (TeX Live 2025) (preloaded format=pdflatex)\r\n restricted \write18 enabled.\r\nentering extended mode\r\n(./Franz_Srambical_CV.tex\r\nLaTeX2e <2024-11-01> patch level 2\r\nL3 programming layer <2025-01-18>\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/base/article.cls\r\nDocument Class: article 2024/06/29 v1.4n Standard LaTeX document class\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/base/size10.clo))\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/graphics/graphicx.sty\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/graphics/keyval.sty)\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/graphics/graphics.sty\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/graphics/trig.sty)\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/graphics-cfg/graphics.cfg)\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/graphics-def/pdftex.def)))\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/babel/babel.sty\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/babel/txtbabel.def)\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/babel-german/ngerman.ldf\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/babel-german/ngermanb.ldf)))\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/babel/locale/de/babel-ngerman.t\r\nex) (/usr/local/texlive/2025/texmf-dist/tex/latex/csquotes/csquotes.sty\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/etoolbox/etoolbox.sty)\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/csquotes/csquotes.def)\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/csquotes/csquotes.cfg))\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/pgf/frontendlayer/tikz.sty\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/pgf/basiclayer/pgf.sty\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/pgf/utilities/pgfrcs.sty\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.te\r\nx)\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def\r\n) (/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/pgf.revision.tex)))\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/pgf/basiclayer/pgfcore.sty\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/pgf/systemlayer/pgfsys.sty\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/utilities/pgfkeyslibraryfil\r\ntered.code.tex))\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg)\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.d\r\nef\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-p\r\ndf.def)))\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.\r\ncode.tex)\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.\r\ncode.tex)) (/usr/local/texlive/2025/texmf-dist/tex/latex/xcolor/xcolor.sty\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/graphics-cfg/color.cfg)\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/graphics/mathcolor.ltx))\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex)\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex\r\n)\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code.\r\ntex)\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.basic\r\n.code.tex)\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.trigo\r\nnometric.code.tex)\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.rando\r\nm.code.tex)\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.compa\r\nrison.code.tex)\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.\r\ncode.tex)\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round\r\n.code.tex)\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.misc.\r\ncode.tex)\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.integ\r\nerarithmetics.code.tex)\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/math/pgfmathcalc.code.tex)\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex)\r\n) (/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/math/pgfint.code.tex)\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.co\r\nde.tex)\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconst\r\nruct.code.tex)\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage\r\n.code.tex)\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.co\r\nde.tex)\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicst\r\nate.code.tex)\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransform\r\nations.code.tex)\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.cod\r\ne.tex)\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.c\r\node.tex)\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathproce\r\nssing.code.tex)\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.co\r\nde.tex)\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.cod\r\ne.tex)\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.cod\r\ne.tex)\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.\r\ncode.tex)\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/basiclayer/pgfcorelayers.co\r\nde.tex)\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretranspare\r\nncy.code.tex)\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.\r\ncode.tex)\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/basiclayer/pgfcorerdf.code.\r\ntex)))\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/modules/pgfmoduleshapes.cod\r\ne.tex)\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/modules/pgfmoduleplot.code.\r\ntex)\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version\r\n-0-65.sty)\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version\r\n-1-18.sty))\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/pgf/utilities/pgffor.sty\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/pgf/utilities/pgfkeys.sty\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex)\r\n) (/usr/local/texlive/2025/texmf-dist/tex/latex/pgf/math/pgfmath.sty\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex))\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex))\r\n\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/frontendlayer/tikz/tikz.cod\r\ne.tex\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/libraries/pgflibraryplothan\r\ndlers.code.tex)\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/modules/pgfmodulematrix.cod\r\ne.tex)\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pgf/frontendlayer/tikz/librarie\r\ns/tikzlibrarytopaths.code.tex)))\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/geometry/geometry.sty\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/iftex/ifvtex.sty\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/iftex/iftex.sty)))\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/base/inputenc.sty)\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/mdwtools/mdwlist.sty)\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/base/fontenc.sty)\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/base/textcomp.sty)\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/tex-gyre/tgpagella.sty\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/kvoptions/kvoptions.sty\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty)\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/kvsetkeys/kvsetkeys.sty)))\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/hyperref/hyperref.sty\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/kvdefinekeys/kvdefinekeys.sty)\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pdfescape/pdfescape.sty\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/pdftexcmds/pdftexcmds.sty\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/infwarerr/infwarerr.sty)))\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/hycolor/hycolor.sty)\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/hyperref/nameref.sty\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/refcount/refcount.sty)\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/gettitlestring/gettitlestring.s\r\nty)) (/usr/local/texlive/2025/texmf-dist/tex/generic/stringenc/stringenc.sty)\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/hyperref/pd1enc.def)\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/intcalc/intcalc.sty)\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/hyperref/puenc.def)\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/url/url.sty)\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/bitset/bitset.sty\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/bigintcalc/bigintcalc.sty))\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/base/atbegshi-ltx.sty))\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/hyperref/hpdftex.def\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/base/atveryend-ltx.sty)\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/rerunfilecheck/rerunfilecheck.sty\r\n\r\n(/usr/local/texlive/2025/texmf-dist/tex/generic/uniquecounter/uniquecounter.sty\r\n)))\r\n\r\nPackage csquotes Warning: Load 'inputenc' before 'csquotes' on input line 49.\r\n\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/tex-gyre/t1qpl.fd)\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def)\r\n(./Franz_Srambical_CV.aux)\r\n(/usr/local/texlive/2025/texmf-dist/tex/context/base/mkii/supp-pdf.mkii\r\n[Loading MPS to PDF converter (version 2006.09.02).]\r\n) (/usr/local/texlive/2025/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))\r\n*geometry* driver: auto-detecting\r\n*geometry* detected driver: pdftex\r\n(./Franz_Srambical_CV.out) (./Franz_Srambical_CV.out)\r\n\r\n! LaTeX Error: File `Franz_Srambical-Foto' not found.\r\n\r\nSee the LaTeX manual or LaTeX Companion for explanation.\r\nType H <return> for immediate help.\r\n ... \r\n \r\nl.54 ...raphics[height=3cm]{Franz_Srambical-Foto}}\r\n };\r\n? ",,terminal_output
|
| 65 |
+
64,91595,"TERMINAL",0,0,"\r\n(/usr/local/texlive/2025/texmf-dist/tex/latex/tex-gyre/ts1qpl.fd)\r\n[1{/usr/local/texlive/2025/texmf-var/fonts/map/pdftex/updmap/pdftex.map",,terminal_output
|
| 66 |
+
65,91753,"TERMINAL",0,0,"}{/usr/l\r\nocal/texlive/2025/texmf-dist/fonts/enc/dvips/tex-gyre/q-ec.enc}{/usr/local/texl\r\nive/2025/texmf-dist/fonts/enc/dvips/tex-gyre/q-ts1.enc}{/usr/local/texlive/2025\r\n/texmf-dist/fonts/enc/dvips/cm-super/cm-super-t1.enc}]\r\n(./Franz_Srambical_CV.aux) )</usr/local/texlive/2025/texmf-dist/fonts/type1/pub\r\nlic/tex-gyre/qplb.pfb></usr/local/texlive/2025/texmf-dist/fonts/type1/public/te\r\nx-gyre/qplr.pfb></usr/local/texlive/2025/texmf-dist/fonts/type1/public/tex-gyre\r\n/qplri.pfb></usr/local/texlive/2025/texmf-dist/fonts/type1/public/cm-super/sftt\r\n1000.pfb>\r\nOutput written on Franz_Srambical_CV.pdf (1 page, 203236 bytes).\r\nTranscript written on Franz_Srambical_CV.log.\r\n[1m[7m%[27m[1m[0m \r \r",,terminal_output
|
| 67 |
+
66,143370,"TERMINAL",0,0,"open Franz_Srambical_CV.pdf",,terminal_command
|
| 68 |
+
67,143420,"TERMINAL",0,0,"]633;C",,terminal_output
|
| 69 |
+
68,143558,"TERMINAL",0,0,"[1m[7m%[27m[1m[0m \r \r",,terminal_output
|
| 70 |
+
69,494422,"TERMINAL",0,0,"open .",,terminal_command
|
| 71 |
+
70,494476,"TERMINAL",0,0,"]633;C",,terminal_output
|
| 72 |
+
71,494563,"TERMINAL",0,0,"[1m[7m%[27m[1m[0m \r \r",,terminal_output
|
4de8d861ed2563988d5f1871647ebc5fe70861b32d24a4b32f9363518653a328/crowd-code-d7f8bf70-6436-4993-9f3a-388c9dd920c41755360610934-2025_08_16-18.10.16.703/source.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
4de8d861ed2563988d5f1871647ebc5fe70861b32d24a4b32f9363518653a328/crowd-code-e2abe726-9da1-4509-8b31-095e99ad14241758788312330-2025_09_25-10.18.38.778/source.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
4de8d861ed2563988d5f1871647ebc5fe70861b32d24a4b32f9363518653a328/crowd-code-f74fb5f7-5770-4723-b86e-ac735e8db6ed1762449341495-2025_11_06-18.15.45.199/source.csv
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Sequence,Time,File,RangeOffset,RangeLength,Text,Language,Type
|
| 2 |
+
1,2,"src/extension.ts",0,0,"import * as vscode from 'vscode';\nimport * as http from 'http';\nimport { Buffer } from 'buffer';\n\nexport function activate(context: vscode.ExtensionContext) {\n\n\tconsole.log('[crowd-pilot] Extension activated');\n\n\t// Configure terminal to allow tab keybinding to work\n\t(async () => {\n\t\tconst config = vscode.workspace.getConfiguration('terminal.integrated');\n\t\tconst commandsToSkipShell = config.get<string[]>('commandsToSkipShell', []);\n\t\tlet updated = false;\n\t\tif (!commandsToSkipShell.includes('crowd-pilot.testRun')) {\n\t\t\tcommandsToSkipShell.push('crowd-pilot.testRun');\n\t\t\tupdated = true;\n\t\t}\n\t\tif (!commandsToSkipShell.includes('crowd-pilot.hideUi')) {\n\t\t\tcommandsToSkipShell.push('crowd-pilot.hideUi');\n\t\t\tupdated = true;\n\t\t}\n\t\tif (updated) {\n\t\t\tawait config.update('commandsToSkipShell', commandsToSkipShell, vscode.ConfigurationTarget.Global);\n\t\t}\n\t\t// Prime terminal subsystem after intercept is enabled (NOTE: this is a workaround)\n\t\tawait primeTerminalSubsystem();\n\t})().catch((err) => console.error('[crowd-pilot] Startup initialization error:', err));\n\n\tconst testRun = vscode.commands.registerCommand('crowd-pilot.testRun', async () => {\n\t\tconst editor = vscode.window.activeTextEditor;\n\t\tif (!editor) {\n\t\t\treturn;\n\t\t}\n\t\tconst doc = editor.document;\n\t\tconst term = vscode.window.terminals[0] ?? vscode.window.createTerminal('Test');\n\t\tconst plan = buildTestRunPlan(editor, doc, term);\n\n\t\tif (!previewVisible) {\n\t\t\tshowPreviewUI(plan);\n\t\t\treturn;\n\t\t}\n\n\t\tconst runPlan = currentPlan ?? plan;\n\t\thidePreviewUI();\n\n\t\tawait executePlan(runPlan);\n\t\tvscode.window.showInformationMessage('All actions emitted');\n\t });\n\n\tconst hideUi = vscode.commands.registerCommand('crowd-pilot.hideUi', () => {\n\t\thidePreviewUI();\n\t});\n\n\tconst sglangTest = vscode.commands.registerCommand('crowd-pilot.sglangTest', async () => {\n\t\ttry {\n\t\t\tconst portInput = await vscode.window.showInputBox({\n\t\t\t\tprompt: 'Enter SGLang server port',\n\t\t\t\tvalue: '30000'\n\t\t\t});\n\t\t\tif (!portInput) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst port = Number(portInput);\n\t\t\tif (!Number.isFinite(port) || port <= 0) {\n\t\t\t\tvscode.window.showErrorMessage('Invalid port');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tawait callSGLangChat(port);\n\t\t} catch (err) {\n\t\t\tconst errorMessage = err instanceof Error ? err.message : String(err);\n\t\t\tvscode.window.showErrorMessage(`SGLang test failed: ${errorMessage}`);\n\t\t}\n\t});\n\n\tcontext.subscriptions.push(testRun, hideUi, sglangTest);\n}\n\nexport function deactivate() {}\n\nasync function primeTerminalSubsystem(): Promise<void> {\n\ttry {\n\t\tif (vscode.window.terminals.length > 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst opened = new Promise<void>((resolve) => {\n\t\t\tconst d = vscode.window.onDidOpenTerminal(() => {\n\t\t\t\ttry { d.dispose(); } catch {}\n\t\t\t\tresolve();\n\t\t\t});\n\t\t});\n\t\tconst t = vscode.window.createTerminal('crowd-pilot prime');\n\t\tawait Promise.race([\n\t\t\topened,\n\t\t\tnew Promise<void>(r => setTimeout(r, 150))\n\t\t]);\n\t\ttry { t.dispose(); } catch {}\n\t\tawait new Promise<void>(r => setTimeout(r, 50));\n\t\tconsole.log('[crowd-pilot] Primed terminal subsystem');\n\t} catch (err) {\n\t\tconsole.error('[crowd-pilot] Failed to prime terminal subsystem:', err);\n\t}\n}\n\n// -------------------- Plan Types & Execution --------------------\ntype PlannedAction =\n| { kind: 'showTextDocument' }\n| { kind: 'setSelections', selections: Array<{ start: [number, number], end: [number, number] }> }\n| { kind: 'editInsert', position: [number, number], text: string }\n| { kind: 'terminalShow' }\n| { kind: 'terminalSendText', text: string };\n\nlet currentPlan: PlannedAction[] | undefined;\n\nfunction buildTestRunPlan(_editor: vscode.TextEditor, _doc: vscode.TextDocument, _term: vscode.Terminal): PlannedAction[] {\n\tconst plan: PlannedAction[] = [];\n\tplan.push({ kind: 'showTextDocument' });\n\tplan.push({ kind: 'setSelections', selections: [{ start: [0, 0], end: [0, 0] }] });\n\tplan.push({ kind: 'editInsert', position: [0, 0], text: 'hello world\n' });\n\tplan.push({ kind: 'terminalShow' });\n\tplan.push({ kind: 'terminalSendText', text: 'echo VSCode test' });\n\treturn plan;\n}\n\nasync function executePlan(plan: PlannedAction[]): Promise<void> {\n\tconst editor = vscode.window.activeTextEditor;\n\tif (!editor) { return; }\n\tconst doc = editor.document;\n\tconst term = vscode.window.terminals[0] ?? vscode.window.createTerminal('Test');\n\tfor (const action of plan) {\n\t\tif (action.kind === 'showTextDocument') {\n\t\t\tawait vscode.window.showTextDocument(doc);\n\t\t\tcontinue;\n\t\t}\n\t\tif (action.kind === 'setSelections') {\n\t\t\teditor.selections = action.selections.map(s => new vscode.Selection(\n\t\t\t\tnew vscode.Position(s.start[0], s.start[1]),\n\t\t\t\tnew vscode.Position(s.end[0], s.end[1])\n\t\t\t));\n\t\t\tcontinue;\n\t\t}\n\t\tif (action.kind === 'editInsert') {\n\t\t\tawait editor.edit((e: vscode.TextEditorEdit) => e.insert(new vscode.Position(action.position[0], action.position[1]), action.text));\n\t\t\tcontinue;\n\t\t}\n\t\tif (action.kind === 'terminalShow') {\n\t\t\tterm.show();\n\t\t\tcontinue;\n\t\t}\n\t\tif (action.kind === 'terminalSendText') {\n\t\t\tterm.sendText(action.text);\n\t\t\tcontinue;\n\t\t}\n\t}\n}\n\n// -------------------- UI State & Helpers --------------------\nconst UI_CONTEXT_KEY = 'crowdPilot.uiVisible';\nlet previewVisible = false;\nlet previewQuickPick: vscode.QuickPick<(vscode.QuickPickItem & { index: number })> | undefined;\n\nfunction showPreviewUI(plan: PlannedAction[]): void {\n\tconst items: (vscode.QuickPickItem & { index: number })[] = plan.map((action, index) => {\n\t\tswitch (action.kind) {\n\t\t\tcase 'showTextDocument':\n\t\t\t\treturn { index, label: '$(file) Focus active text document' };\n\t\t\tcase 'setSelections':\n\t\t\t\t{\n\t\t\t\t\tconst cursors = action.selections.map(s => `(${s.start[0]}, ${s.start[1]})`).join(', ');\n\t\t\t\t\treturn { index, label: `$(cursor) Move cursor to ${cursors}` };\n\t\t\t\t}\n\t\t\tcase 'editInsert':\n\t\t\t\treturn { index, label: `$(pencil) Insert ""${action.text.replace(/\n/g, '\\n')}"" at (${action.position[0]}, ${action.position[1]})` };\n\t\t\tcase 'terminalShow':\n\t\t\t\treturn { index, label: '$(terminal) Focus terminal' };\n\t\t\tcase 'terminalSendText':\n\t\t\t\treturn { index, label: `$(terminal) Run ""${action.text}"" in terminal` };\n\t\t}\n\t});\n if (!previewQuickPick) {\n previewQuickPick = vscode.window.createQuickPick<(vscode.QuickPickItem & { index: number })>();\n\t\tpreviewQuickPick.title = 'crowd-pilot: preview';\n\t\tpreviewQuickPick.matchOnDetail = true;\n\t\tpreviewQuickPick.ignoreFocusOut = true;\n\t\tpreviewQuickPick.canSelectMany = false;\n previewQuickPick.onDidAccept(async () => {\n const qp = previewQuickPick!;\n const selected = qp.selectedItems?.[0];\n qp.hide();\n if (selected) {\n await executePlan([plan[selected.index]]);\n vscode.window.showInformationMessage('Action executed');\n }\n });\n\t\tpreviewQuickPick.onDidHide(() => {\n\t\t\tpreviewVisible = false;\n\t\t\tvscode.commands.executeCommand('setContext', UI_CONTEXT_KEY, false);\n\t\t\ttry { previewQuickPick?.dispose(); } catch {}\n\t\t\tpreviewQuickPick = undefined;\n\t\t});\n\t}\n\tpreviewQuickPick.items = items;\n\tpreviewQuickPick.placeholder = 'Press Tab to run all, Enter for selected, or Esc to hide';\n\tpreviewQuickPick.show();\n\tpreviewVisible = true;\n\tvscode.commands.executeCommand('setContext', UI_CONTEXT_KEY, true);\n\tcurrentPlan = plan;\n}\n\nfunction hidePreviewUI(): void {\n\tif (previewQuickPick) {\n\t\ttry { previewQuickPick.hide(); } catch {}\n\t\treturn;\n\t}\n\tpreviewVisible = false;\n\tvscode.commands.executeCommand('setContext', UI_CONTEXT_KEY, false);\n}\n\n// -------------------- SGLang Client (simple test) --------------------\nasync function callSGLangChat(port: number): Promise<void> {\n\tconst requestBody = {\n\t\tmodel: 'qwen/qwen2.5-0.5b-instruct',\n\t\tmessages: [\n\t\t\t{ role: 'user', content: 'What is the capital of France?' }\n\t\t]\n\t};\n\tconst postData = JSON.stringify(requestBody);\n\n\tconst options = {\n\t\thostname: 'localhost',\n\t\tport: port,\n\t\tpath: '/v1/chat/completions',\n\t\tmethod: 'POST',\n\t\theaders: {\n\t\t\t'Content-Type': 'application/json',\n\t\t\t'Content-Length': Buffer.byteLength(postData)\n\t\t}\n\t};\n\n\ttry {\n\t\tconst json = await new Promise<any>((resolve, reject) => {\n\t\t\tconst req = http.request(options, (res: http.IncomingMessage) => {\n\t\t\t\tlet data = '';\n\t\t\t\tres.on('data', (chunk: Buffer) => {\n\t\t\t\t\tdata += chunk.toString();\n\t\t\t\t});\n\t\t\t\tres.on('end', () => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tresolve(JSON.parse(data));\n\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\treject(new Error(`Failed to parse response: ${err instanceof Error ? err.message : String(err)}`));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\n\t\t\treq.on('error', (err: Error) => {\n\t\t\t\treject(err);\n\t\t\t});\n\n\t\t\treq.write(postData);\n\t\t\treq.end();\n\t\t});\n\n\t\tvscode.window.showInformationMessage(`SGLang response: ${JSON.stringify(json, null, 2)}`);\n\t} catch (err) {\n\t\tconst errorMessage = err instanceof Error ? err.message : String(err);\n\t\tvscode.window.showErrorMessage(`SGLang request failed: ${errorMessage}`);\n\t}\n}\n",typescript,tab
|
| 3 |
+
2,92,"extension-output-pdoom-org.crowd-code-#1-crowd-code",0,0,"6:15:45 PM [info] Activating crowd-code\n6:15:45 PM [info] Recording started\n6:15:45 PM [info] Initializing git provider using file system watchers...\n6:15:45 PM [info] Git repository found\n6:15:45 PM [info] Git provider initialized successfully\n",Log,tab
|
| 4 |
+
3,121,"extension-output-pdoom-org.crowd-code-#1-crowd-code",245,0,"6:15:45 PM [info] Initial git state: [object Object]\n",Log,content
|
| 5 |
+
4,1218,"src/extension.ts",0,0,"",typescript,tab
|
| 6 |
+
5,18456,"src/extension.ts",161,7,"console",typescript,selection_command
|
| 7 |
+
6,22452,"src/extension.ts",211,0,"",typescript,selection_mouse
|
| 8 |
+
7,29464,"src/extension.ts",87,8,"'buffer'",typescript,selection_command
|
| 9 |
+
8,1522807,"src/extension.ts",94,0,"",typescript,selection_command
|
| 10 |
+
9,1531662,"TERMINAL",0,0," * Executing task: npm run watch ",,terminal_command
|
| 11 |
+
10,1531976,"TERMINAL",0,0,"\r\n> crowd-pilot@0.0.1 watch\r\n> tsc -watch -p ./\r\n\r\n[1G[0Ksh: tsc: command not found\r\n[1G[0K⠙[1G[0K",,terminal_output
|
| 12 |
+
11,1557683,"src/extension.ts",161,7,"console",typescript,selection_command
|
| 13 |
+
12,1557697,"src/extension.ts",99,192,"xport function activate(context: vscode.ExtensionContext) {\n\n\tconsole.log('[crowd-pilot] Extension activated');\n\n\t// Configure terminal to allow tab keybinding to work\n\t(async () => {\n\t\tconst ",typescript,selection_command
|
| 14 |
+
13,1557699,"src/extension.ts",98,0,"",typescript,selection_command
|
| 15 |
+
14,1682084,"src/extension.ts",0,99,"import * as vscode from 'vscode';\nimport * as http from 'http';\nimport { Buffer } from 'buffer';\n\ne",typescript,selection_command
|
| 16 |
+
15,1682760,"src/extension.ts",0,0,"",typescript,selection_command
|
| 17 |
+
16,1683101,"src/extension.ts",34,0,"",typescript,selection_command
|
| 18 |
+
17,1683188,"src/extension.ts",64,0,"",typescript,selection_command
|
| 19 |
+
18,1683918,"src/extension.ts",64,33,"",typescript,content
|
| 20 |
+
19,1687181,"src/extension.ts",7896,0,"",typescript,selection_command
|
| 21 |
+
20,1690206,"src/extension.ts",7896,0,"v",typescript,content
|
| 22 |
+
21,1690213,"src/extension.ts",7897,0,"",typescript,selection_keyboard
|
| 23 |
+
22,1690329,"src/extension.ts",7897,0,"s",typescript,content
|
| 24 |
+
23,1690332,"src/extension.ts",7898,0,"",typescript,selection_keyboard
|
| 25 |
+
24,1690428,"src/extension.ts",7898,0,"c",typescript,content
|
| 26 |
+
25,1690431,"src/extension.ts",7899,0,"",typescript,selection_keyboard
|
| 27 |
+
26,1690523,"src/extension.ts",7899,0,"o",typescript,content
|
| 28 |
+
27,1690526,"src/extension.ts",7900,0,"",typescript,selection_keyboard
|
| 29 |
+
28,1690679,"src/extension.ts",7900,0,"d",typescript,content
|
| 30 |
+
29,1690684,"src/extension.ts",7901,0,"",typescript,selection_keyboard
|
| 31 |
+
30,1691082,"src/extension.ts",7901,0,"e",typescript,content
|
| 32 |
+
31,1691087,"src/extension.ts",7902,0,"",typescript,selection_keyboard
|
| 33 |
+
32,1691246,"src/extension.ts",7896,6,"vscode",typescript,content
|
| 34 |
+
33,1691248,"src/extension.ts",7902,0,".",typescript,content
|
| 35 |
+
34,1691252,"src/extension.ts",7903,0,"",typescript,selection_keyboard
|
| 36 |
+
35,1691378,"src/extension.ts",7902,0,"",typescript,selection_command
|
| 37 |
+
36,1692250,"src/extension.ts",7903,0,"",typescript,selection_command
|
| 38 |
+
37,1696497,"src/extension.ts",8124,0,"",typescript,selection_command
|
| 39 |
+
38,1697576,"src/extension.ts",8124,0,"vscode.",typescript,content
|
| 40 |
+
39,1697824,"src/extension.ts",7903,0,"",typescript,selection_command
|
| 41 |
+
40,1722963,"src/extension.ts",3001,74,"\t\tconst msg = err instanceof Error ? err.message : String(err);\n\t\tvscode.window.showErrorMessage(`crowd-pilot: Failed to prime terminal: ${msg}`);",typescript,content
|
| 42 |
+
41,1722963,"src/extension.ts",2926,57,"\t\tvscode.window.setStatusBarMessage('crowd-pilot: Terminal primed', 1500);",typescript,content
|
| 43 |
+
42,1722963,"src/extension.ts",943,88,"\t})().catch((err) => {\n\t\tconst msg = err instanceof Error ? err.message : String(err);\n\t\tvscode.window.showErrorMessage(`crowd-pilot: Startup initialization error: ${msg}`);\n\t});",typescript,content
|
| 44 |
+
43,1722963,"src/extension.ts",127,50,"\tvscode.window.setStatusBarMessage('crowd-pilot: Activated', 2000);",typescript,content
|
| 45 |
+
44,1767991,"src/extension.ts",7954,0,"",typescript,selection_mouse
|
| 46 |
+
45,1768002,"src/extension.ts",7953,0,"",typescript,selection_command
|
| 47 |
+
46,1768846,"src/extension.ts",0,0,"",typescript,selection_command
|
| 48 |
+
47,1770847,"src/extension.ts",34,0,"",typescript,selection_command
|
| 49 |
+
48,1770997,"src/extension.ts",64,0,"",typescript,selection_command
|
| 50 |
+
49,1771128,"src/extension.ts",65,0,"",typescript,selection_command
|
| 51 |
+
50,1771282,"src/extension.ts",126,0,"",typescript,selection_command
|
| 52 |
+
51,1771454,"src/extension.ts",127,0,"",typescript,selection_command
|
| 53 |
+
52,1771598,"src/extension.ts",195,0,"",typescript,selection_command
|
| 54 |
+
53,1772131,"src/extension.ts",127,0,"",typescript,selection_command
|
| 55 |
+
54,1774376,"src/extension.ts",128,0,"",typescript,selection_command
|
| 56 |
+
55,1774569,"src/extension.ts",134,0,"",typescript,selection_command
|
| 57 |
+
56,1774756,"src/extension.ts",135,0,"",typescript,selection_command
|
| 58 |
+
57,1774884,"src/extension.ts",141,0,"",typescript,selection_command
|
| 59 |
+
58,1775068,"src/extension.ts",142,0,"",typescript,selection_command
|
| 60 |
+
59,1783107,"src/extension.ts",166,0,"",typescript,selection_command
|
| 61 |
+
60,1783743,"src/extension.ts",163,0,"",typescript,selection_command
|
| 62 |
+
61,1783901,"src/extension.ts",161,0,"",typescript,selection_command
|
| 63 |
+
62,1784190,"src/extension.ts",142,0,"",typescript,selection_command
|
| 64 |
+
63,1786713,"src/extension.ts",141,0,"",typescript,selection_command
|
| 65 |
+
64,1786851,"src/extension.ts",135,0,"",typescript,selection_command
|
| 66 |
+
65,1787287,"src/extension.ts",1056,0,"",typescript,selection_command
|
| 67 |
+
66,1787418,"src/extension.ts",1250,0,"",typescript,selection_command
|
| 68 |
+
67,1787834,"src/extension.ts",1360,0,"",typescript,selection_command
|
| 69 |
+
68,1790451,"src/extension.ts",1502,0,"",typescript,selection_command
|
| 70 |
+
69,1791201,"src/extension.ts",1644,0,"",typescript,selection_command
|
| 71 |
+
70,1792610,"src/extension.ts",1644,1,"s",typescript,selection_command
|
| 72 |
+
71,1792868,"src/extension.ts",1644,22,"showInformationMessage",typescript,selection_command
|
| 73 |
+
72,1793394,"src/extension.ts",1665,0,"",typescript,selection_command
|
| 74 |
+
73,1793768,"src/extension.ts",0,0,"",typescript,selection_command
|
| 75 |
+
74,1793986,"src/extension.ts",1063,0,"",typescript,selection_command
|
| 76 |
+
75,1794919,"src/extension.ts",999,0,"",typescript,selection_command
|
| 77 |
+
76,1795165,"src/extension.ts",976,0,"",typescript,selection_command
|
| 78 |
+
77,1795194,"src/extension.ts",942,0,"",typescript,selection_command
|
| 79 |
+
78,1795227,"src/extension.ts",856,0,"",typescript,selection_command
|
| 80 |
+
79,1795261,"src/extension.ts",838,0,"",typescript,selection_command
|
| 81 |
+
80,1795295,"src/extension.ts",749,0,"",typescript,selection_command
|
| 82 |
+
81,1795327,"src/extension.ts",731,0,"",typescript,selection_command
|
| 83 |
+
82,1795361,"src/extension.ts",714,0,"",typescript,selection_command
|
| 84 |
+
83,1795392,"src/extension.ts",709,0,"",typescript,selection_command
|
| 85 |
+
84,1795426,"src/extension.ts",658,0,"",typescript,selection_command
|
| 86 |
+
85,1795461,"src/extension.ts",597,0,"",typescript,selection_command
|
| 87 |
+
86,1795493,"src/extension.ts",579,0,"",typescript,selection_command
|
| 88 |
+
87,1795526,"src/extension.ts",574,0,"",typescript,selection_command
|
| 89 |
+
88,1795560,"src/extension.ts",522,0,"",typescript,selection_command
|
| 90 |
+
89,1795592,"src/extension.ts",460,0,"",typescript,selection_command
|
| 91 |
+
90,1795627,"src/extension.ts",437,0,"",typescript,selection_command
|
| 92 |
+
91,1795659,"src/extension.ts",358,0,"",typescript,selection_command
|
| 93 |
+
92,1795694,"src/extension.ts",283,0,"",typescript,selection_command
|
| 94 |
+
93,1795727,"src/extension.ts",265,0,"",typescript,selection_command
|
| 95 |
+
94,1795761,"src/extension.ts",212,0,"",typescript,selection_command
|
| 96 |
+
95,1795795,"src/extension.ts",195,0,"",typescript,selection_command
|
| 97 |
+
96,1795992,"src/extension.ts",143,0,"",typescript,selection_command
|
| 98 |
+
97,1796309,"src/extension.ts",142,0,"",typescript,selection_command
|
| 99 |
+
98,1796577,"src/extension.ts",142,1,"s",typescript,selection_command
|
| 100 |
+
99,1796746,"src/extension.ts",142,19,"setStatusBarMessage",typescript,selection_command
|
| 101 |
+
100,1799322,"src/extension.ts",142,19,"\nimport { Buffer } from 'buffer';\n",typescript,content
|
| 102 |
+
101,1799373,"src/extension.ts",143,0,"",typescript,selection_command
|
4de8d861ed2563988d5f1871647ebc5fe70861b32d24a4b32f9363518653a328/crowd-code-fe6bab45-8dbd-4344-8582-4a82ec593b5b1761822935724-2025_10_30-12.15.44.980/source.csv
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Sequence,Time,File,RangeOffset,RangeLength,Text,Language,Type
|
| 2 |
+
1,3,"jasmine/baselines/maskgit/train_dynamics_maskgit.py",0,0,"import os\n\n\nos.environ.setdefault(""XLA_PYTHON_CLIENT_MEM_FRACTION"", ""0.98"")\n\nfrom dataclasses import dataclass, field\nimport itertools\nfrom typing import cast, Optional\n\nimport einops\nfrom jax.sharding import Mesh, PartitionSpec, NamedSharding\nfrom jax.experimental.mesh_utils import create_device_mesh\nimport optax\nimport orbax.checkpoint as ocp\nimport numpy as np\nimport dm_pix as pix\nimport jax\nimport jax.numpy as jnp\nimport tyro\nimport wandb\nimport grain\nimport flax.nnx as nnx\n\nfrom jasmine.models.genie import GenieMaskGIT, restore_genie_components\nfrom jasmine.utils.dataloader import get_dataloader\nfrom jasmine.utils.train_utils import (\n get_lr_schedule,\n count_parameters_by_component,\n print_mem_stats,\n print_compiled_memory_stats,\n print_compiled_cost_analysis,\n)\n\n\n@dataclass\nclass Args:\n # Experiment\n num_steps: int = 200_000\n seed: int = 0\n seq_len: int = 16\n image_channels: int = 3\n image_height: int = 64\n image_width: int = 64\n data_dir: str = """"\n save_ckpt: bool = False\n restore_ckpt: bool = False\n # Optimization\n batch_size: int = 36\n init_lr: float = 0.0\n max_lr: float = 3e-5\n decay_end: float = 0.0\n wsd_decay_steps: int = (\n 20_000 # NOTE: wsd_decay_steps will only be used when using a wsd-schedule\n )\n warmup_steps: int = 5000\n lr_schedule: str = ""wsd"" # supported options: wsd, cos\n # Tokenizer\n tokenizer_dim: int = 512\n tokenizer_ffn_dim: int = 2048\n latent_patch_dim: int = 32\n num_patch_latents: int = 1024\n patch_size: int = 16\n tokenizer_num_blocks: int = 4\n tokenizer_num_heads: int = 8\n tokenizer_checkpoint: str = """"\n # LAM\n lam_dim: int = 512\n lam_ffn_dim: int = 2048\n latent_action_dim: int = 32\n num_actions: int = 6\n lam_patch_size: int = 16\n lam_num_blocks: int = 4\n lam_num_heads: int = 8\n lam_checkpoint: str = """"\n # Dynamics\n dyna_dim: int = 512\n dyna_ffn_dim: int = 2048\n dyna_num_blocks: int = 6\n dyna_num_heads: int = 8\n dropout: float = 0.0\n mask_limit: float = 0.5\n z_loss_weight: float = 0.0\n param_dtype = jnp.float32\n dtype = jnp.bfloat16\n use_flash_attention: bool = True\n use_gt_actions: bool = False\n # Logging\n log: bool = True\n entity: str = """"\n project: str = """"\n name: str = ""train_dynamics_maskgit""\n tags: list[str] = field(default_factory=lambda: [""dynamics"", ""maskgit""])\n log_interval: int = 50\n log_image_interval: int = 1000\n ckpt_dir: str = """"\n log_checkpoint_interval: int = 5000\n log_checkpoint_keep_period: int = 20_000\n log_gradients: bool = False\n val_data_dir: str = """"\n val_interval: int = 20_000\n val_steps: int = 50\n eval_full_frame: bool = True\n val_maskgit_steps: int = 25\n val_temperature: float = 1\n val_sample_argmax: bool = False\n wandb_id: str = """"\n\n\ndef build_model(args: Args, rng: jax.Array) -> tuple[GenieMaskGIT, jax.Array]:\n rng, _rng = jax.random.split(rng)\n rngs = nnx.Rngs(_rng)\n genie = GenieMaskGIT(\n # Tokenizer\n in_dim=args.image_channels,\n tokenizer_dim=args.tokenizer_dim,\n tokenizer_ffn_dim=args.tokenizer_ffn_dim,\n latent_patch_dim=args.latent_patch_dim,\n num_patch_latents=args.num_patch_latents,\n patch_size=args.patch_size,\n tokenizer_num_blocks=args.tokenizer_num_blocks,\n tokenizer_num_heads=args.tokenizer_num_heads,\n # LAM\n lam_dim=args.lam_dim,\n lam_ffn_dim=args.lam_ffn_dim,\n latent_action_dim=args.latent_action_dim,\n num_actions=args.num_actions,\n lam_patch_size=args.lam_patch_size,\n lam_num_blocks=args.lam_num_blocks,\n lam_num_heads=args.lam_num_heads,\n lam_co_train=not args.lam_checkpoint,\n use_gt_actions=args.use_gt_actions,\n # Dynamics\n dyna_type=""maskgit"",\n dyna_dim=args.dyna_dim,\n dyna_ffn_dim=args.dyna_ffn_dim,\n dyna_num_blocks=args.dyna_num_blocks,\n dyna_num_heads=args.dyna_num_heads,\n dropout=args.dropout,\n mask_limit=args.mask_limit,\n param_dtype=args.param_dtype,\n dtype=args.dtype,\n use_flash_attention=args.use_flash_attention,\n decode=False,\n rngs=rngs,\n )\n if args.use_gt_actions:\n assert (\n not args.lam_checkpoint\n ), ""Cannot use LAM when using ground-truth actions.""\n else:\n assert genie.lam is not None\n del genie.lam.decoder\n return genie, rng\n\n\ndef build_optimizer(genie: GenieMaskGIT, args: Args) -> nnx.ModelAndOptimizer:\n lr_schedule = get_lr_schedule(\n args.lr_schedule,\n args.init_lr,\n args.max_lr,\n args.decay_end,\n args.num_steps,\n args.warmup_steps,\n args.wsd_decay_steps,\n )\n tx = optax.adamw(\n learning_rate=lr_schedule,\n b1=0.9,\n b2=0.9,\n weight_decay=1e-4,\n mu_dtype=args.param_dtype, # moments in full precision\n )\n optimizer = nnx.ModelAndOptimizer(genie, tx)\n return optimizer\n\n\ndef build_mesh_and_sharding(\n num_devices: int,\n) -> tuple[Mesh, NamedSharding, NamedSharding, NamedSharding]:\n device_mesh_arr = create_device_mesh((num_devices,))\n mesh = Mesh(devices=device_mesh_arr, axis_names=(""data"",))\n replicated_sharding = NamedSharding(mesh, PartitionSpec())\n videos_sharding = NamedSharding(mesh, PartitionSpec(""data"", None, None, None, None))\n actions_sharding = NamedSharding(mesh, PartitionSpec(""data"", None))\n return mesh, replicated_sharding, videos_sharding, actions_sharding\n\n\ndef shard_optimizer_states(\n optimizer: nnx.ModelAndOptimizer, replicated_sharding: NamedSharding\n) -> None:\n model_state = nnx.state(optimizer.model)\n model_sharded_state = jax.lax.with_sharding_constraint(\n model_state, replicated_sharding\n )\n nnx.update(optimizer.model, model_sharded_state)\n optimizer_state = nnx.state(optimizer, nnx.optimizer.OptState)\n optimizer_sharded_state = jax.lax.with_sharding_constraint(\n optimizer_state, replicated_sharding\n )\n nnx.update(optimizer, optimizer_sharded_state)\n\n\ndef build_dataloader(args: Args, data_dir: str) -> grain.DataLoaderIterator:\n image_shape = (args.image_height, args.image_width, args.image_channels)\n array_record_files = [\n os.path.join(data_dir, x)\n for x in os.listdir(data_dir)\n if x.endswith("".array_record"")\n ]\n grain_dataloader = get_dataloader(\n array_record_files,\n args.seq_len,\n # NOTE: We deliberately pass the global batch size\n # The dataloader shards the dataset across all processes\n args.batch_size,\n *image_shape,\n num_workers=8,\n prefetch_buffer_size=1,\n seed=args.seed,\n )\n initial_state = grain_dataloader._create_initial_state()\n grain_iterator = grain.DataLoaderIterator(grain_dataloader, initial_state)\n return grain_iterator\n\n\ndef build_checkpoint_manager(args: Args) -> Optional[ocp.CheckpointManager]:\n if args.restore_ckpt or args.save_ckpt:\n handler_registry = ocp.handlers.DefaultCheckpointHandlerRegistry()\n handler_registry.add(\n ""model_state"", ocp.args.PyTreeSave, ocp.handlers.PyTreeCheckpointHandler\n )\n handler_registry.add(\n ""model_state"", ocp.args.PyTreeRestore, ocp.handlers.PyTreeCheckpointHandler\n )\n handler_registry.add(\n ""train_dataloader_state"",\n grain.checkpoint.CheckpointSave,\n cast(ocp.handlers.CheckpointHandler, grain.checkpoint.CheckpointHandler),\n )\n handler_registry.add(\n ""train_dataloader_state"",\n grain.checkpoint.CheckpointRestore,\n cast(ocp.handlers.CheckpointHandler, grain.checkpoint.CheckpointHandler),\n )\n if args.val_data_dir:\n handler_registry.add(\n ""val_dataloader_state"",\n grain.checkpoint.CheckpointSave,\n cast(\n ocp.handlers.CheckpointHandler, grain.checkpoint.CheckpointHandler\n ),\n )\n handler_registry.add(\n ""val_dataloader_state"",\n grain.checkpoint.CheckpointRestore,\n cast(\n ocp.handlers.CheckpointHandler, grain.checkpoint.CheckpointHandler\n ),\n )\n checkpoint_options = ocp.CheckpointManagerOptions(\n save_interval_steps=args.log_checkpoint_interval,\n max_to_keep=3,\n keep_period=args.log_checkpoint_keep_period,\n step_format_fixed_length=6,\n cleanup_tmp_directories=True,\n )\n checkpoint_manager = ocp.CheckpointManager(\n args.ckpt_dir,\n options=checkpoint_options,\n handler_registry=handler_registry,\n )\n return checkpoint_manager\n else:\n return None\n\n\ndef restore_or_initialize_components(\n args: Args,\n checkpoint_manager: Optional[ocp.CheckpointManager],\n optimizer: nnx.ModelAndOptimizer,\n train_iterator: grain.DataLoaderIterator,\n rng: jax.Array,\n replicated_sharding: NamedSharding,\n val_iterator: Optional[grain.DataLoaderIterator],\n restore_step: Optional[int] = None,\n) -> tuple[\n int,\n nnx.ModelAndOptimizer,\n grain.DataLoaderIterator,\n grain.DataLoaderIterator,\n jax.Array,\n]:\n step = 0\n if checkpoint_manager and restore_step is None:\n restore_step = checkpoint_manager.latest_step()\n if args.restore_ckpt:\n assert checkpoint_manager is not None\n abstract_optimizer = nnx.eval_shape(lambda: optimizer)\n abstract_optimizer_state = nnx.state(abstract_optimizer)\n if val_iterator:\n restore_args = ocp.args.Composite(\n model_state=ocp.args.PyTreeRestore(abstract_optimizer_state), # type: ignore\n train_dataloader_state=grain.checkpoint.CheckpointRestore(train_iterator), # type: ignore\n val_dataloader_state=grain.checkpoint.CheckpointRestore(val_iterator), # type: ignore\n )\n else:\n restore_args = ocp.args.Composite(\n model_state=ocp.args.PyTreeRestore(abstract_optimizer_state), # type: ignore\n train_dataloader_state=grain.checkpoint.CheckpointRestore(train_iterator), # type: ignore\n )\n restored = checkpoint_manager.restore(\n checkpoint_manager.latest_step(), args=restore_args\n )\n restored_optimizer_state = restored[""model_state""]\n nnx.update(optimizer, restored_optimizer_state)\n train_iterator = restored[""train_dataloader_state""]\n if val_iterator:\n val_iterator = restored[""val_dataloader_state""]\n step = checkpoint_manager.latest_step() or 0\n print(f""Restored dataloader and model state from step {step}"")\n else:\n # Restore from pre-trained tokenizer (and LAM)\n rng, _rng = jax.random.split(rng)\n optimizer = restore_genie_components(\n optimizer, replicated_sharding, _rng, ""vqvae"", args\n )\n return step, optimizer, train_iterator, val_iterator, rng\n\n\ndef _calculate_top_k_accuracy(\n token_logits_BTNV: jax.Array,\n video_tokens_BTN: jax.Array,\n mask_BTN: jax.Array,\n k: int,\n) -> jax.Array:\n _, topk_indices_BTNK = jax.lax.top_k(token_logits_BTNV, k)\n topk_correct = jnp.any(\n topk_indices_BTNK == video_tokens_BTN[..., jnp.newaxis], axis=-1\n )\n topk_acc = (mask_BTN * topk_correct).sum() / mask_BTN.sum()\n return topk_acc\n\n\ndef _calculate_step_metrics(\n outputs: dict[str, jax.Array],\n gt: jax.Array,\n num_actions: int,\n num_patch_latents: int,\n) -> tuple[jax.Array, dict]:\n mask_BTN = outputs[""mask""]\n outputs[""token_logits""] = outputs[""token_logits""].astype(jnp.float32)\n ce_loss = optax.softmax_cross_entropy_with_integer_labels(\n outputs[""token_logits""], outputs[""video_tokens""]\n )\n ce_loss = (mask_BTN * ce_loss).sum() / mask_BTN.sum()\n z_val = jax.nn.logsumexp(outputs[""token_logits""], axis=-1)\n z_loss_metric = (mask_BTN * (z_val**2)).sum() / mask_BTN.sum()\n\n masked_token_top_1_acc = _calculate_top_k_accuracy(\n outputs[""token_logits""], outputs[""video_tokens""], mask_BTN, 1\n )\n masked_token_top_2_acc = _calculate_top_k_accuracy(\n outputs[""token_logits""], outputs[""video_tokens""], mask_BTN, 2\n )\n masked_token_top_5_acc = _calculate_top_k_accuracy(\n outputs[""token_logits""], outputs[""video_tokens""], mask_BTN, 5\n )\n masked_token_top_16_acc = _calculate_top_k_accuracy(\n outputs[""token_logits""], outputs[""video_tokens""], mask_BTN, 16\n )\n\n select_probs = jax.nn.softmax(outputs[""token_logits""])\n gt_val = gt.clip(0, 1).reshape(-1, *gt.shape[2:])\n recon = outputs[""recon""].clip(0, 1).reshape(-1, *outputs[""recon""].shape[2:])\n psnr = jnp.asarray(pix.psnr(gt_val, recon)).mean()\n ssim = jnp.asarray(pix.ssim(gt_val, recon)).mean()\n _, index_counts_tokenizer = jnp.unique_counts(\n jnp.ravel(outputs[""video_tokens""]),\n size=num_patch_latents,\n fill_value=0,\n )\n codebook_usage_tokenizer = (index_counts_tokenizer != 0).mean()\n metrics = dict(\n cross_entropy_loss=ce_loss,\n masked_token_top1_accuracy=masked_token_top_1_acc,\n masked_token_top2_accuracy=masked_token_top_2_acc,\n masked_token_top5_accuracy=masked_token_top_5_acc,\n masked_token_top16_accuracy=masked_token_top_16_acc,\n select_logit=outputs[""token_logits""].max(-1).mean(),\n select_p=select_probs.max(-1).mean(),\n entropy=jax.scipy.special.entr(select_probs).sum(-1).mean(),\n z_loss=z_loss_metric,\n psnr=psnr,\n ssim=ssim,\n codebook_usage_tokenizer=codebook_usage_tokenizer,\n )\n if ""lam_indices"" in outputs.keys():\n _, index_counts_lam = jnp.unique_counts(\n jnp.ravel(outputs[""lam_indices""]),\n size=num_actions,\n fill_value=0,\n )\n codebook_usage_lam = (index_counts_lam != 0).mean()\n metrics[""codebook_usage_lam""] = codebook_usage_lam\n return ce_loss, metrics\n\n\ndef main(args: Args) -> None:\n jax.distributed.initialize()\n num_devices = jax.device_count()\n if num_devices == 0:\n raise ValueError(""No JAX devices found."")\n print(f""Running on {num_devices} devices."")\n\n if args.batch_size % num_devices != 0:\n raise ValueError(\n f""Global batch size {args.batch_size} must be divisible by ""\n f""number of devices {num_devices}.""\n )\n\n rng = jax.random.key(args.seed)\n\n # --- Initialize model ---\n genie, rng = build_model(args, rng)\n _, params, _ = nnx.split(genie, nnx.Param, ...)\n param_counts = count_parameters_by_component(params)\n\n if args.log and jax.process_index() == 0:\n wandb_init_kwargs = {\n ""entity"": args.entity,\n ""project"": args.project,\n ""name"": args.name,\n ""tags"": args.tags,\n ""group"": ""debug"",\n ""config"": args,\n }\n\n if args.wandb_id:\n wandb_init_kwargs.update(\n {\n ""id"": args.wandb_id,\n ""resume"": ""allow"",\n }\n )\n wandb.init(**wandb_init_kwargs)\n\n wandb.config.update({""model_param_count"": param_counts})\n\n print(""Parameter counts:"")\n print(param_counts)\n\n # --- Initialize optimizer ---\n optimizer = build_optimizer(genie, args)\n del genie\n\n # FIXME: switch to create_hybrid_device_mesh for runs spanning multiple nodes\n _, replicated_sharding, videos_sharding, actions_sharding = build_mesh_and_sharding(\n num_devices\n )\n\n shard_optimizer_states(optimizer, replicated_sharding)\n\n # --- Initialize checkpoint manager ---\n checkpoint_manager = build_checkpoint_manager(args)\n\n # --- Create DataLoaderIterator from dataloader ---\n train_iterator = build_dataloader(args, args.data_dir)\n val_iterator = None\n if args.val_data_dir:\n val_iterator = build_dataloader(args, args.val_data_dir)\n\n # --- Restore checkpoint ---\n step, optimizer, train_iterator, val_iterator, rng = (\n restore_or_initialize_components(\n args,\n checkpoint_manager,\n optimizer,\n train_iterator,\n rng,\n replicated_sharding,\n val_iterator,\n )\n )\n\n # --- Define loss and train step (close over args) ---\n def dynamics_loss_fn(\n model: GenieMaskGIT,\n inputs: dict,\n ) -> tuple[jax.Array, tuple[jax.Array, dict]]:\n gt = jnp.asarray(inputs[""videos""], dtype=jnp.float32) / 255.0\n inputs[""videos""] = gt.astype(args.dtype)\n outputs = model(inputs)\n ce_loss, metrics = _calculate_step_metrics(\n outputs, gt, args.num_actions, args.num_patch_latents\n )\n z_loss = metrics[""z_loss""]\n total_loss = ce_loss + args.z_loss_weight * z_loss\n metrics[""total_loss""] = total_loss\n return total_loss, (outputs[""recon""], metrics)\n\n @nnx.jit(donate_argnums=0)\n def train_step(\n optimizer: nnx.ModelAndOptimizer, inputs: dict\n ) -> tuple[jax.Array, jax.Array, dict]:\n def loss_fn(model: GenieMaskGIT) -> tuple[jax.Array, tuple[jax.Array, dict]]:\n model.train()\n return dynamics_loss_fn(model, inputs)\n\n (loss, (recon, metrics)), grads = nnx.value_and_grad(loss_fn, has_aux=True)(\n optimizer.model\n )\n optimizer.update(grads)\n if args.log_gradients:\n metrics[""gradients_std/""] = jax.tree.map(\n lambda x: x.std(), grads[""params""][""dynamics""]\n )\n return loss, recon, metrics\n\n @nnx.jit\n def val_step(genie: GenieMaskGIT, inputs: dict) -> dict:\n """"""Evaluate model and compute metrics""""""\n genie.eval()\n gt = jnp.asarray(inputs[""videos""], dtype=jnp.float32) / 255.0\n (loss, (recon, metrics)) = dynamics_loss_fn(genie, inputs)\n val_output = {""loss"": loss, ""recon"": recon, ""metrics"": metrics}\n\n # --- Evaluate full frame prediction (sampling) ---\n if args.eval_full_frame:\n inputs[""videos""] = gt.astype(args.dtype)\n tokenizer_outputs = genie.tokenizer.vq_encode(\n inputs[""videos""], training=False\n )\n tokens_full_frame = tokenizer_outputs[""indices""]\n lam_indices_E = None\n if not args.use_gt_actions:\n lam_indices_E = genie.vq_encode(inputs, training=False)\n inputs[""latent_actions""] = lam_indices_E\n inputs[""videos""] = inputs[""videos""][\n :, :-1\n ] # remove last frame for generation\n recon_full_frame, logits_full_frame = genie.sample_maskgit(\n inputs,\n args.seq_len,\n args.val_maskgit_steps,\n args.val_temperature,\n args.val_sample_argmax,\n )\n # Calculate metrics for the last frame only\n step_outputs = {\n ""recon"": recon_full_frame[:, -1],\n ""token_logits"": logits_full_frame[:, -1],\n ""video_tokens"": tokens_full_frame[:, -1],\n ""mask"": jnp.ones_like(tokens_full_frame[:, -1]),\n }\n if lam_indices_E is not None:\n lam_indices_B = lam_indices_E.reshape((-1, args.seq_len - 1))[:, -1]\n step_outputs[""lam_indices""] = lam_indices_B\n\n loss_full_frame, metrics_full_frame = _calculate_step_metrics(\n step_outputs, gt[:, -1], args.num_actions, args.num_patch_latents\n )\n val_output.update(\n {\n ""loss_full_frame"": loss_full_frame,\n ""recon_full_frame"": recon_full_frame,\n ""metrics_full_frame"": metrics_full_frame,\n }\n )\n return val_output\n\n def calculate_validation_metrics(val_dataloader, genie, rng):\n step = 0\n loss_per_step = []\n metrics_per_step = []\n loss_full_frame_per_step = []\n metrics_full_frame_per_step = []\n batch = None\n recon = None\n recon_full_frame = None\n for batch in val_dataloader:\n rng, _rng_mask = jax.random.split(rng, 2)\n batch[""rng""] = _rng_mask\n val_outputs = val_step(genie, batch)\n loss_per_step.append(val_outputs[""loss""])\n metrics_per_step.append(val_outputs[""metrics""])\n recon = val_outputs[""recon""]\n if args.eval_full_frame:\n loss_full_frame_per_step.append(val_outputs[""loss_full_frame""])\n metrics_full_frame_per_step.append(val_outputs[""metrics_full_frame""])\n recon_full_frame = val_outputs[""recon_full_frame""]\n step += 1\n if step > args.val_steps:\n break\n\n if step < args.val_steps:\n print(\n f""Warning: Your validation dataset is too small to make val_steps many steps. Made {step} steps, expected {args.val_steps}""\n )\n\n val_metrics = {\n f""val_{key}"": np.mean([float(m[key]) for m in metrics_per_step])\n for key in metrics_per_step[0].keys()\n }\n val_metrics[""val_loss""] = np.mean(loss_per_step)\n if args.eval_full_frame:\n val_metrics_full_frame = {\n f""val_full_frame_{key}"": np.mean(\n [float(m[key]) for m in metrics_full_frame_per_step]\n )\n for key in metrics_full_frame_per_step[0].keys()\n }\n val_metrics.update(val_metrics_full_frame)\n val_metrics[""val_full_frame_loss""] = np.mean(loss_full_frame_per_step)\n return val_metrics, batch, recon, recon_full_frame\n\n # --- TRAIN LOOP ---\n dataloader_train = (\n {\n ""videos"": jax.make_array_from_process_local_data(\n videos_sharding, local_data=elem[""videos""]\n ),\n ""actions"": (\n jax.make_array_from_process_local_data(\n actions_sharding, elem[""actions""]\n )\n if args.use_gt_actions\n else None\n ),\n }\n for elem in train_iterator\n )\n dataloader_val = None\n if val_iterator:\n dataloader_val = (\n {\n ""videos"": jax.make_array_from_process_local_data(\n videos_sharding, elem[""videos""]\n ),\n ""actions"": (\n jax.make_array_from_process_local_data(\n actions_sharding, elem[""actions""]\n )\n if args.use_gt_actions\n else None\n ),\n }\n for elem in val_iterator\n )\n if jax.process_index() == 0:\n first_batch = next(dataloader_train)\n first_batch[""rng""] = rng # type: ignore\n compiled = train_step.lower(optimizer, first_batch).compile()\n print_compiled_memory_stats(compiled.memory_analysis())\n print_compiled_cost_analysis(compiled.cost_analysis())\n # Do not skip the first batch during training\n dataloader_train = itertools.chain([first_batch], dataloader_train)\n print(f""Starting training from step {step}..."")\n first_step = step\n while step < args.num_steps:\n for batch in dataloader_train:\n # --- Train step ---\n rng, _rng_mask = jax.random.split(rng, 2)\n batch[""rng""] = _rng_mask\n loss, recon, metrics = train_step(optimizer, batch)\n if step == first_step:\n print_mem_stats(""After params initialized"")\n step += 1\n\n # --- Validation loss ---\n val_results = {}\n if dataloader_val and step % args.val_interval == 0:\n rng, _rng_mask_val = jax.random.split(rng, 2)\n print(""Calculating validation metrics..."")\n val_metrics, val_gt_batch, val_recon, val_recon_full_frame = (\n calculate_validation_metrics(\n dataloader_val, optimizer.model, _rng_mask_val\n )\n )\n print(f""Step {step}, validation loss: {val_metrics['val_loss']}"")\n val_results = {\n ""metrics"": val_metrics,\n ""gt_batch"": val_gt_batch,\n ""recon"": val_recon,\n ""full_frame"": val_recon_full_frame,\n }\n\n # --- Logging ---\n if args.log:\n if step % args.log_interval == 0 and jax.process_index() == 0:\n log_dict = {""loss"": loss, ""step"": step, **metrics}\n if val_results:\n log_dict.update(val_results[""metrics""])\n wandb.log(log_dict)\n if step % args.log_image_interval == 0:\n gt_seq = batch[""videos""][0].astype(jnp.float32) / 255.0\n recon_seq = recon[0].clip(0, 1)\n comparison_seq = jnp.concatenate((gt_seq, recon_seq), axis=1)\n comparison_seq = einops.rearrange(\n comparison_seq * 255, ""t h w c -> h (t w) c""\n )\n if val_results:\n val_results[""gt_seq_val""] = (\n val_results[""gt_batch""][""videos""][0].astype(jnp.float32)\n / 255.0\n )\n val_results[""recon_seq_val""] = val_results[""recon""][0].clip(\n 0, 1\n )\n val_comparison_seq = jnp.concatenate(\n (val_results[""gt_seq_val""], val_results[""recon_seq_val""]),\n axis=1,\n )\n val_results[""val_comparison_seq""] = einops.rearrange(\n val_comparison_seq * 255, ""t h w c -> h (t w) c""\n )\n if args.eval_full_frame:\n val_results[""full_frame_seq_val""] = val_results[\n ""full_frame""\n ][0].clip(0, 1)\n val_results[""val_full_frame_comparison_seq""] = (\n jnp.concatenate(\n (\n val_results[""gt_seq_val""],\n val_results[""full_frame_seq_val""],\n ),\n axis=1,\n )\n )\n val_results[""val_full_frame_comparison_seq""] = (\n einops.rearrange(\n val_results[""val_full_frame_comparison_seq""] * 255,\n ""t h w c -> h (t w) c"",\n )\n )\n # NOTE: Process-dependent control flow deliberately happens\n # after indexing operation since it must not contain code\n # sections that lead to cross-accelerator communication.\n if jax.process_index() == 0:\n log_images = dict(\n image=wandb.Image(np.asarray(gt_seq[args.seq_len - 1])),\n recon=wandb.Image(np.asarray(recon_seq[args.seq_len - 1])),\n true_vs_recon=wandb.Image(\n np.asarray(comparison_seq.astype(np.uint8))\n ),\n )\n if val_results:\n log_images.update(\n dict(\n val_image=wandb.Image(\n np.asarray(\n val_results[""gt_seq_val""][args.seq_len - 1]\n )\n ),\n val_recon=wandb.Image(\n np.asarray(\n val_results[""recon_seq_val""][\n args.seq_len - 1\n ]\n )\n ),\n val_true_vs_recon=wandb.Image(\n np.asarray(\n val_results[""val_comparison_seq""].astype(\n np.uint8\n )\n )\n ),\n )\n )\n if args.eval_full_frame:\n log_images.update(\n dict(\n val_full_frame=wandb.Image(\n np.asarray(\n val_results[""full_frame_seq_val""][\n args.seq_len - 1\n ]\n )\n ),\n val_true_vs_full_frame=wandb.Image(\n np.asarray(\n val_results[\n ""val_full_frame_comparison_seq""\n ].astype(np.uint8)\n )\n ),\n )\n )\n wandb.log(log_images)\n # --- Checkpointing ---\n if args.save_ckpt and step % args.log_checkpoint_interval == 0:\n assert checkpoint_manager is not None\n optimizer_state = nnx.state(optimizer)\n if val_iterator:\n ckpt_manager_args = ocp.args.Composite(\n model_state=ocp.args.PyTreeSave(optimizer_state), # type: ignore\n train_dataloader_state=grain.checkpoint.CheckpointSave( # type: ignore\n train_iterator # type: ignore\n ),\n val_dataloader_state=grain.checkpoint.CheckpointSave( # type: ignore\n val_iterator # type: ignore\n ),\n )\n else:\n ckpt_manager_args = ocp.args.Composite(\n model_state=ocp.args.PyTreeSave(optimizer_state), # type: ignore\n train_dataloader_state=grain.checkpoint.CheckpointSave( # type: ignore\n train_iterator # type: ignore\n ),\n )\n checkpoint_manager.save(step, args=ckpt_manager_args)\n print(f""Saved checkpoint at step {step}"")\n if step >= args.num_steps:\n break\n\n if checkpoint_manager:\n checkpoint_manager.close()\n\n\nif __name__ == ""__main__"":\n args = tyro.cli(Args)\n main(args)\n",python,tab
|
| 3 |
+
2,303,"extension-output-pdoom-org.crowd-code-#1-crowd-code",0,0,"12:15:44 PM [info] Activating crowd-code\n12:15:44 PM [info] Recording started\n12:15:44 PM [info] Initializing git provider using file system watchers...\n",Log,tab
|
| 4 |
+
3,382,"extension-output-pdoom-org.crowd-code-#1-crowd-code",153,0,"12:15:45 PM [info] Git repository found\n12:15:45 PM [info] Git provider initialized successfully\n12:15:45 PM [info] Initial git state: [object Object]\n",Log,content
|
| 5 |
+
4,2439,"TERMINAL",0,0,"",,terminal_command
|
| 6 |
+
5,9200,"TERMINAL",0,0,"",,terminal_command
|
| 7 |
+
6,117202,"TERMINAL",0,0,"",,terminal_command
|
| 8 |
+
7,836336,"jasmine/baselines/maskgit/train_dynamics_maskgit.py",0,0,"",python,tab
|
| 9 |
+
8,1561425,"jasmine/baselines/maskgit/train_dynamics_maskgit.py",10398,0,"",python,selection_command
|
| 10 |
+
9,1561559,"jasmine/baselines/maskgit/train_dynamics_maskgit.py",10384,0,"",python,selection_command
|
| 11 |
+
10,1562067,"jasmine/baselines/maskgit/train_dynamics_maskgit.py",0,0,"",python,selection_command
|
| 12 |
+
11,1563648,"jasmine/baselines/maskgit/train_dynamics_maskgit.py",10384,0,"",python,selection_command
|
| 13 |
+
12,1565225,"extension-output-pdoom-org.crowd-code-#1-crowd-code",0,0,"",Log,tab
|
| 14 |
+
13,1565712,"jasmine/baselines/maskgit/train_dynamics_maskgit.py",0,0,"",python,tab
|
927a8af5474e5654810c00ce2e09fd2de87d3e5722f33fa1090d867db114e403/crowd-code-02926e22-9f84-4c50-97ec-2b0fbc4d6bce1755077833038-2025_08_13-11.37.48.400/source.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
927a8af5474e5654810c00ce2e09fd2de87d3e5722f33fa1090d867db114e403/crowd-code-392753c8-d661-449c-9452-1f9aef37f3dd1751408731666-2025_07_02-00.25.54.94/source.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
927a8af5474e5654810c00ce2e09fd2de87d3e5722f33fa1090d867db114e403/crowd-code-6d45d368-d651-4f6d-8ac0-d27b6829b40f1752915727518-2025_07_19-11.02.37.733/source.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
927a8af5474e5654810c00ce2e09fd2de87d3e5722f33fa1090d867db114e403/crowd-code-c38e4133-7017-434b-b277-0fdfd25cf9ed1758613134471-2025_09_23-09.39.23.15/source.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
927a8af5474e5654810c00ce2e09fd2de87d3e5722f33fa1090d867db114e403/crowd-code-f5bc5c4e-6e75-4e39-8fc9-7d347b597b511756988790704-2025_09_04-14.26.41.759/source.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|