Add files using upload-large-folder tool
Browse files- LTA_openwebtext_dualt/logs/rollout_smoke/lta_owt_gpt2cached_len1024_rollout1_p05_smoke4gpu_findunused_20260513_144057.log +123 -0
- LTA_openwebtext_dualt/mini_owt_logdirichlet/.venv_qwen35_uv/lib/python3.12/site-packages/mdurl-0.1.2.dist-info/INSTALLER +1 -0
- LTA_openwebtext_dualt/mini_owt_logdirichlet/.venv_qwen35_uv/lib/python3.12/site-packages/mdurl-0.1.2.dist-info/LICENSE +46 -0
- LTA_openwebtext_dualt/mini_owt_logdirichlet/.venv_qwen35_uv/lib/python3.12/site-packages/mdurl-0.1.2.dist-info/METADATA +32 -0
- LTA_openwebtext_dualt/mini_owt_logdirichlet/.venv_qwen35_uv/lib/python3.12/site-packages/mdurl-0.1.2.dist-info/RECORD +13 -0
- LTA_openwebtext_dualt/mini_owt_logdirichlet/.venv_qwen35_uv/lib/python3.12/site-packages/mdurl-0.1.2.dist-info/REQUESTED +0 -0
- LTA_openwebtext_dualt/mini_owt_logdirichlet/.venv_qwen35_uv/lib/python3.12/site-packages/mdurl-0.1.2.dist-info/WHEEL +4 -0
- LTA_openwebtext_dualt/mini_owt_logdirichlet/.venv_qwen35_uv/lib/python3.12/site-packages/numpy/array_api/tests/__init__.py +7 -0
- LTA_openwebtext_dualt/mini_owt_logdirichlet/.venv_qwen35_uv/lib/python3.12/site-packages/numpy/array_api/tests/test_array_object.py +395 -0
- LTA_openwebtext_dualt/mini_owt_logdirichlet/.venv_qwen35_uv/lib/python3.12/site-packages/numpy/array_api/tests/test_elementwise_functions.py +114 -0
- LTA_openwebtext_dualt/mini_owt_logdirichlet/.venv_qwen35_uv/lib/python3.12/site-packages/numpy/array_api/tests/test_manipulation_functions.py +37 -0
- LTA_openwebtext_dualt/mini_owt_logdirichlet/.venv_qwen35_uv/lib/python3.12/site-packages/numpy/array_api/tests/test_sorting_functions.py +23 -0
- LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr3e3_ema0p9999_elfopt_not5_bottleneck16_unfixed_norm_stateprobadd_selfcond_ce_fast_20260612_030202/step_048000.pt +3 -0
- LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr3e3_ema0p9999_elfopt_not5_bottleneck16_unfixed_norm_stateprobadd_selfcond_ce_fast_20260612_030202/step_314000.pt +3 -0
- LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr3e3_ema0p9999_elfopt_not5_bottleneck16_unfixed_norm_stateprobadd_selfcond_ce_fast_20260612_030202/step_319000.pt +3 -0
- LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr3e3_ema0p9999_elfopt_not5_bottleneck256_unfixed_norm_stateprobadd_selfcond_ce_fast_20260612_050225/step_013000.pt +3 -0
- LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr3e3_ema0p9999_elfopt_not5_bottleneck256_unfixed_norm_stateprobadd_selfcond_ce_fast_20260612_050225/step_240000.pt +3 -0
- LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr3e3_ema0p9999_elfopt_not5_bottleneck256_unfixed_norm_stateprobadd_selfcond_ce_fast_20260612_050225/step_241000.pt +3 -0
- LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr3e3_ema0p9999_elfopt_not5_bottleneck256_unfixed_norm_stateprobadd_selfcond_ce_fast_20260612_050225/step_498000.pt +3 -0
- LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr3e3_ema0p9999_elfopt_not5_bottleneck256_unfixed_norm_stateprobadd_selfcond_ce_fast_20260612_050225/step_520000.pt +3 -0
LTA_openwebtext_dualt/logs/rollout_smoke/lta_owt_gpt2cached_len1024_rollout1_p05_smoke4gpu_findunused_20260513_144057.log
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[launch] method=owt_categorical_fullvocab_c1024_fullycoupled host=di-20260411014000-djqhq time=2026-05-13T14:40:57+00:00
|
| 2 |
+
[launch] cwd=/e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt
|
| 3 |
+
[launch] run_name=lta_owt_gpt2cached_len1024_rollout1_p05_smoke4gpu_findunused_20260513_144057
|
| 4 |
+
[launch] save_dir=runs/lta_owt_gpt2cached_len1024_rollout1_p05_smoke4gpu_findunused_20260513_144057
|
| 5 |
+
[launch] log_file=logs/lta_owt_gpt2cached_len1024_rollout1_p05_smoke4gpu_findunused_20260513_144057.log
|
| 6 |
+
[launch] data_path=/e2e-data/evad-tech-vla/wanghan58/data/small_benchmarks/langflow_2604_11748/openwebtext
|
| 7 |
+
[launch] tokenizer=/e2e-data/evad-tech-vla/wanghan58/models/flowtext_scorers/gpt2-standard/tokenizer.json
|
| 8 |
+
[launch] split=train_minus_100k text_column=text
|
| 9 |
+
[launch] owt_cached_chunks=1 cache_dir=/e2e-data/evad-tech-vla/wanghan58/data/small_benchmarks/langflow_2604_11748/openwebtext_lta_cached_chunks/gpt2_len1024_train_minus_100k
|
| 10 |
+
[launch] nproc_per_node=4 global_batch_size=8 per_gpu_batch_size=2
|
| 11 |
+
[launch] model d_model=768 n_layers=12 n_heads=12 dim_ff=3072 dropout=0.0
|
| 12 |
+
[launch] optimizer=adamw lr=6e-4 wd=0.1 ema=0.0
|
| 13 |
+
[launch] rollout_train prob=0.5 steps=1 infer_steps=64 temp=1.45 max_gamma=1.0 corrupt_only=1
|
| 14 |
+
[launch] perf allow_tf32=1 activation_checkpointing=0 checkpoint_interval=1 prefetch=2
|
| 15 |
+
NCCL version 2.25.1+cuda12.8
|
| 16 |
+
{
|
| 17 |
+
"device": "cuda:0",
|
| 18 |
+
"rank": 0,
|
| 19 |
+
"world_size": 4,
|
| 20 |
+
"samples": "owt_cached_chunks:8734897",
|
| 21 |
+
"vocab_size": 50257,
|
| 22 |
+
"tokenizer_vocab_size": 50257,
|
| 23 |
+
"save_dir": "runs/lta_owt_gpt2cached_len1024_rollout1_p05_smoke4gpu_findunused_20260513_144057",
|
| 24 |
+
"batch_size": 2,
|
| 25 |
+
"grad_accum": 1,
|
| 26 |
+
"effective_batch_size": 8,
|
| 27 |
+
"global_batch_size": 8,
|
| 28 |
+
"lr_schedule": "cosine",
|
| 29 |
+
"optimizer": "adamw",
|
| 30 |
+
"warmup_steps": 1,
|
| 31 |
+
"min_lr": 6e-05,
|
| 32 |
+
"weight_decay": 0.1,
|
| 33 |
+
"adamw_param_groups": "nanogpt",
|
| 34 |
+
"adam_beta1": 0.9,
|
| 35 |
+
"adam_beta2": 0.95,
|
| 36 |
+
"adam_eps": 1e-08,
|
| 37 |
+
"muon_momentum": 0.95,
|
| 38 |
+
"muon_ns_steps": 5,
|
| 39 |
+
"muon_update_scale": 1.0,
|
| 40 |
+
"ema_decay": 0.0,
|
| 41 |
+
"ema_start_step": 0,
|
| 42 |
+
"model_type": "ddit",
|
| 43 |
+
"dual_t": true,
|
| 44 |
+
"corrupt_t_mode": "same",
|
| 45 |
+
"corrupt_min_t": 0.0,
|
| 46 |
+
"corrupt_max_t": 1.0,
|
| 47 |
+
"prefix_block_prob": 0.0,
|
| 48 |
+
"prefix_block_len": 128,
|
| 49 |
+
"dirichlet_endpoint_mode": "categorical_dual_t",
|
| 50 |
+
"dirichlet_semantic_t_mode": "same",
|
| 51 |
+
"dirichlet_semantic_t_value": 0.0,
|
| 52 |
+
"categorical_wrong_from_full_vocab": true,
|
| 53 |
+
"categorical_wrong_from_batch_valid_tokens": false,
|
| 54 |
+
"mask_mixture_original_prob": 0.0,
|
| 55 |
+
"mask_mixture_lowk_prob": 0.0,
|
| 56 |
+
"mask_mixture_lowcorrupt_prob": 0.0,
|
| 57 |
+
"mask_mixture_block_prob": 0.0,
|
| 58 |
+
"mask_mixture_all_prob": 0.0,
|
| 59 |
+
"mask_mixture_lowk_clean_tokens": "1,2,4,8,16,32,64",
|
| 60 |
+
"mask_mixture_lowcorrupt_tokens": "1,2,4,8,16,32,64",
|
| 61 |
+
"mask_mixture_block_tokens": "64,128",
|
| 62 |
+
"simplex_bridge_sampler": "dirichlet",
|
| 63 |
+
"logistic_normal_sigma_min": 0.18,
|
| 64 |
+
"logistic_normal_sigma_max": 2.2,
|
| 65 |
+
"logistic_normal_tau_min": 0.65,
|
| 66 |
+
"logistic_normal_tau_max": 1.15,
|
| 67 |
+
"torch_compile": false,
|
| 68 |
+
"compile_mode": "max-autotune",
|
| 69 |
+
"state_format": "prob",
|
| 70 |
+
"target_loss": "hard_ce",
|
| 71 |
+
"meanflow_weight": 0.0,
|
| 72 |
+
"rollout_train_prob": 0.5,
|
| 73 |
+
"rollout_train_steps": 1,
|
| 74 |
+
"rollout_train_infer_steps": 64,
|
| 75 |
+
"rollout_train_temp": 1.45,
|
| 76 |
+
"rollout_train_max_gamma": 1.0,
|
| 77 |
+
"rollout_train_corrupt_only": true,
|
| 78 |
+
"bridge_noise_init": "logistic_normal",
|
| 79 |
+
"noise_sigma": -1.0,
|
| 80 |
+
"allow_tf32": true,
|
| 81 |
+
"activation_checkpointing": false,
|
| 82 |
+
"activation_checkpoint_interval": 1,
|
| 83 |
+
"ddp_static_graph": false,
|
| 84 |
+
"ddp_gradient_as_bucket_view": true,
|
| 85 |
+
"blocking_data_transfer": false,
|
| 86 |
+
"dataloader_prefetch_factor": 2,
|
| 87 |
+
"full_train_stats": false,
|
| 88 |
+
"record_pad_truncate": false,
|
| 89 |
+
"record_add_eos": false,
|
| 90 |
+
"record_add_special_tokens": false,
|
| 91 |
+
"record_pad_token": "pad",
|
| 92 |
+
"record_shuffle_buffer": 10000,
|
| 93 |
+
"wrap": true,
|
| 94 |
+
"wrap_mode": "stream",
|
| 95 |
+
"wrap_record_buffer_size": 200,
|
| 96 |
+
"owt_cached_chunks": true,
|
| 97 |
+
"owt_chunk_cache_dir": "/e2e-data/evad-tech-vla/wanghan58/data/small_benchmarks/langflow_2604_11748/openwebtext_lta_cached_chunks/gpt2_len1024_train_minus_100k",
|
| 98 |
+
"owt_chunk_cache_rebuild": false,
|
| 99 |
+
"owt_chunk_cache_write_batch": 4096,
|
| 100 |
+
"owt_exact_repeat_per_chunk": 0,
|
| 101 |
+
"online_chunk_shuffle": false,
|
| 102 |
+
"online_chunk_shuffle_buffer": 10000,
|
| 103 |
+
"openwebtext_split": "train_minus_100k",
|
| 104 |
+
"detokenizer": "auto",
|
| 105 |
+
"resolved_detokenizer": null,
|
| 106 |
+
"num_workers": 0,
|
| 107 |
+
"latest_every": 100000,
|
| 108 |
+
"resume_path": ""
|
| 109 |
+
}
|
| 110 |
+
[rank2]:[W513 14:41:05.836660309 reducer.cpp:1400] Warning: find_unused_parameters=True was specified in DDP constructor, but did not find any unused parameters in the forward pass. This flag results in an extra traversal of the autograd graph every iteration, which can adversely affect performance. If your model indeed never has any unused parameters in the forward pass, consider turning this flag off. Note that this warning may be a false positive if your model has flow control causing later iterations to have unused parameters. (function operator())
|
| 111 |
+
[rank1]:[W513 14:41:05.836716202 reducer.cpp:1400] Warning: find_unused_parameters=True was specified in DDP constructor, but did not find any unused parameters in the forward pass. This flag results in an extra traversal of the autograd graph every iteration, which can adversely affect performance. If your model indeed never has any unused parameters in the forward pass, consider turning this flag off. Note that this warning may be a false positive if your model has flow control causing later iterations to have unused parameters. (function operator())
|
| 112 |
+
[rank3]:[W513 14:41:05.839719583 reducer.cpp:1400] Warning: find_unused_parameters=True was specified in DDP constructor, but did not find any unused parameters in the forward pass. This flag results in an extra traversal of the autograd graph every iteration, which can adversely affect performance. If your model indeed never has any unused parameters in the forward pass, consider turning this flag off. Note that this warning may be a false positive if your model has flow control causing later iterations to have unused parameters. (function operator())
|
| 113 |
+
step=1 micro_steps=1 elapsed=1.4s lr=6.000000e-04 acc_all=0.0005 acc_corrupt=0.0011 corrupt_frac=0.4424 loss_all=10.8125 loss_corrupt=10.8125 acc_corrupt_t_0p0_0p2=0.0015 corrupt_frac_t_0p0_0p2=0.7163 acc_corrupt_t_0p8_1p0=0.0000 corrupt_frac_t_0p8_1p0=0.2837 loss=10.8125 loss_recon=10.8125 loss_meanflow=0.0000 mean_model_t=0.5059 mean_corrupt_t=0.5059 mean_loss_t_weight=1.0000 prior_center_loss_beta=0.0000 rollout_train_applied=1.0000 wrong_frac=0.6821 init_acc_corrupt=0.2815 init_gold_top10=0.3013 init_gold_top100=0.3918
|
| 114 |
+
[rank0]:[W513 14:41:05.895636578 reducer.cpp:1400] Warning: find_unused_parameters=True was specified in DDP constructor, but did not find any unused parameters in the forward pass. This flag results in an extra traversal of the autograd graph every iteration, which can adversely affect performance. If your model indeed never has any unused parameters in the forward pass, consider turning this flag off. Note that this warning may be a false positive if your model has flow control causing later iterations to have unused parameters. (function operator())
|
| 115 |
+
step=2 micro_steps=2 elapsed=0.1s lr=5.819078e-04 acc_all=0.0000 acc_corrupt=0.0000 corrupt_frac=0.3232 loss_all=10.8125 loss_corrupt=10.8125 acc_corrupt_t_0p0_0p2=0.0000 corrupt_frac_t_0p0_0p2=0.6178 acc_corrupt_t_0p6_0p8=0.0000 corrupt_frac_t_0p6_0p8=0.3822 loss=10.8125 loss_recon=10.8125 loss_meanflow=0.0000 mean_model_t=0.3631 mean_corrupt_t=0.3631 mean_loss_t_weight=1.0000 prior_center_loss_beta=0.0000 rollout_train_applied=0.0000 wrong_frac=0.7160 init_acc_corrupt=0.2795 init_gold_top10=0.2795 init_gold_top100=0.3429
|
| 116 |
+
step=3 micro_steps=3 elapsed=0.1s lr=5.298133e-04 acc_all=0.4302 acc_corrupt=0.3588 corrupt_frac=0.5811 loss_all=10.6629 loss_corrupt=10.6871 acc_corrupt_t_0p6_0p8=0.3588 corrupt_frac_t_0p6_0p8=1.0000 loss=10.6871 loss_recon=10.6871 loss_meanflow=0.0000 mean_model_t=0.7308 mean_corrupt_t=0.7308 mean_loss_t_weight=1.0000 prior_center_loss_beta=0.0000 rollout_train_applied=1.0000 wrong_frac=0.2840 init_acc_corrupt=0.7160 init_gold_top10=0.7168 init_gold_top100=0.7168
|
| 117 |
+
step=4 micro_steps=4 elapsed=0.1s lr=4.500000e-04 acc_all=0.2827 acc_corrupt=0.2268 corrupt_frac=0.8008 loss_all=10.7127 loss_corrupt=10.7345 acc_corrupt_t_0p0_0p2=0.0106 corrupt_frac_t_0p0_0p2=0.4018 acc_corrupt_t_0p6_0p8=0.3721 corrupt_frac_t_0p6_0p8=0.5982 loss=10.7345 loss_recon=10.7345 loss_meanflow=0.0000 mean_model_t=0.4127 mean_corrupt_t=0.4127 mean_loss_t_weight=1.0000 prior_center_loss_beta=0.0000 rollout_train_applied=1.0000 wrong_frac=0.5305 init_acc_corrupt=0.4433 init_gold_top10=0.4585 init_gold_top100=0.4799
|
| 118 |
+
step=5 micro_steps=5 elapsed=0.1s lr=3.520945e-04 acc_all=0.2964 acc_corrupt=0.1670 corrupt_frac=0.4707 loss_all=10.5901 loss_corrupt=10.6589 acc_corrupt_t_0p2_0p4=0.1038 corrupt_frac_t_0p2_0p4=0.5996 acc_corrupt_t_0p6_0p8=0.2617 corrupt_frac_t_0p6_0p8=0.4004 loss=10.6589 loss_recon=10.6589 loss_meanflow=0.0000 mean_model_t=0.4543 mean_corrupt_t=0.4543 mean_loss_t_weight=1.0000 prior_center_loss_beta=0.0000 rollout_train_applied=1.0000 wrong_frac=0.5944 init_acc_corrupt=0.3402 init_gold_top10=0.4046 init_gold_top100=0.4263
|
| 119 |
+
step=6 micro_steps=6 elapsed=0.1s lr=2.479055e-04 acc_all=0.3955 acc_corrupt=0.0596 corrupt_frac=0.1968 loss_all=10.1278 loss_corrupt=10.2238 acc_corrupt_t_0p0_0p2=0.0546 corrupt_frac_t_0p0_0p2=0.7270 acc_corrupt_t_0p2_0p4=0.0727 corrupt_frac_t_0p2_0p4=0.2730 loss=10.2238 loss_recon=10.2238 loss_meanflow=0.0000 mean_model_t=0.1681 mean_corrupt_t=0.1681 mean_loss_t_weight=1.0000 prior_center_loss_beta=0.0000 rollout_train_applied=1.0000 wrong_frac=0.8908 init_acc_corrupt=0.0471 init_gold_top10=0.0819 init_gold_top100=0.3970
|
| 120 |
+
step=7 micro_steps=7 elapsed=0.1s lr=1.500000e-04 acc_all=0.1953 acc_corrupt=0.1684 corrupt_frac=0.5190 loss_all=9.9591 loss_corrupt=9.9885 acc_corrupt_t_0p2_0p4=0.0652 corrupt_frac_t_0p2_0p4=0.3462 acc_corrupt_t_0p8_1p0=0.2230 corrupt_frac_t_0p8_1p0=0.6538 loss=9.9885 loss_recon=9.9885 loss_meanflow=0.0000 mean_model_t=0.5883 mean_corrupt_t=0.5883 mean_loss_t_weight=1.0000 prior_center_loss_beta=0.0000 rollout_train_applied=0.0000 wrong_frac=0.2926 init_acc_corrupt=0.6604 init_gold_top10=0.7065 init_gold_top100=0.7300
|
| 121 |
+
step=8 micro_steps=8 elapsed=0.1s lr=7.018667e-05 acc_all=0.1519 acc_corrupt=0.1220 corrupt_frac=0.7002 loss_all=9.8806 loss_corrupt=9.9239 acc_corrupt_t_0p4_0p6=0.0909 corrupt_frac_t_0p4_0p6=0.3222 acc_corrupt_t_0p6_0p8=0.1368 corrupt_frac_t_0p6_0p8=0.6778 loss=9.9239 loss_recon=9.9239 loss_meanflow=0.0000 mean_model_t=0.5913 mean_corrupt_t=0.5913 mean_loss_t_weight=1.0000 prior_center_loss_beta=0.0000 rollout_train_applied=0.0000 wrong_frac=0.3487 init_acc_corrupt=0.6471 init_gold_top10=0.6513 init_gold_top100=0.6520
|
| 122 |
+
step=9 micro_steps=9 elapsed=0.1s lr=6.000000e-05 acc_all=0.0713 acc_corrupt=0.0556 corrupt_frac=0.8696 loss_all=9.7394 loss_corrupt=9.7479 acc_corrupt_t_0p8_1p0=0.0556 corrupt_frac_t_0p8_1p0=1.0000 loss=9.7479 loss_recon=9.7479 loss_meanflow=0.0000 mean_model_t=0.9805 mean_corrupt_t=0.9805 mean_loss_t_weight=1.0000 prior_center_loss_beta=0.0000 rollout_train_applied=1.0000 wrong_frac=0.0152 init_acc_corrupt=0.5368 init_gold_top10=0.6654 init_gold_top100=0.7456
|
| 123 |
+
step=10 micro_steps=10 elapsed=0.1s lr=6.000000e-05 acc_all=0.1445 acc_corrupt=0.0921 corrupt_frac=0.4189 loss_all=9.5381 loss_corrupt=9.5842 acc_corrupt_t_0p2_0p4=0.0825 corrupt_frac_t_0p2_0p4=0.5932 acc_corrupt_t_0p4_0p6=0.1060 corrupt_frac_t_0p4_0p6=0.4068 loss=9.5842 loss_recon=9.5842 loss_meanflow=0.0000 mean_model_t=0.3837 mean_corrupt_t=0.3837 mean_loss_t_weight=1.0000 prior_center_loss_beta=0.0000 rollout_train_applied=0.0000 wrong_frac=0.6049 init_acc_corrupt=0.3520 init_gold_top10=0.3951 init_gold_top100=0.3951
|
LTA_openwebtext_dualt/mini_owt_logdirichlet/.venv_qwen35_uv/lib/python3.12/site-packages/mdurl-0.1.2.dist-info/INSTALLER
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
uv
|
LTA_openwebtext_dualt/mini_owt_logdirichlet/.venv_qwen35_uv/lib/python3.12/site-packages/mdurl-0.1.2.dist-info/LICENSE
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Copyright (c) 2015 Vitaly Puzrin, Alex Kocharin.
|
| 2 |
+
Copyright (c) 2021 Taneli Hukkinen
|
| 3 |
+
|
| 4 |
+
Permission is hereby granted, free of charge, to any person
|
| 5 |
+
obtaining a copy of this software and associated documentation
|
| 6 |
+
files (the "Software"), to deal in the Software without
|
| 7 |
+
restriction, including without limitation the rights to use,
|
| 8 |
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 9 |
+
copies of the Software, and to permit persons to whom the
|
| 10 |
+
Software is furnished to do so, subject to the following
|
| 11 |
+
conditions:
|
| 12 |
+
|
| 13 |
+
The above copyright notice and this permission notice shall be
|
| 14 |
+
included in all copies or substantial portions of the Software.
|
| 15 |
+
|
| 16 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
| 17 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
| 18 |
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
| 19 |
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
| 20 |
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
| 21 |
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
| 22 |
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
| 23 |
+
OTHER DEALINGS IN THE SOFTWARE.
|
| 24 |
+
|
| 25 |
+
--------------------------------------------------------------------------------
|
| 26 |
+
|
| 27 |
+
.parse() is based on Joyent's node.js `url` code:
|
| 28 |
+
|
| 29 |
+
Copyright Joyent, Inc. and other Node contributors. All rights reserved.
|
| 30 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 31 |
+
of this software and associated documentation files (the "Software"), to
|
| 32 |
+
deal in the Software without restriction, including without limitation the
|
| 33 |
+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
| 34 |
+
sell copies of the Software, and to permit persons to whom the Software is
|
| 35 |
+
furnished to do so, subject to the following conditions:
|
| 36 |
+
|
| 37 |
+
The above copyright notice and this permission notice shall be included in
|
| 38 |
+
all copies or substantial portions of the Software.
|
| 39 |
+
|
| 40 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 41 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 42 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 43 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 44 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
| 45 |
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
| 46 |
+
IN THE SOFTWARE.
|
LTA_openwebtext_dualt/mini_owt_logdirichlet/.venv_qwen35_uv/lib/python3.12/site-packages/mdurl-0.1.2.dist-info/METADATA
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.1
|
| 2 |
+
Name: mdurl
|
| 3 |
+
Version: 0.1.2
|
| 4 |
+
Summary: Markdown URL utilities
|
| 5 |
+
Keywords: markdown,commonmark
|
| 6 |
+
Author-email: Taneli Hukkinen <hukkin@users.noreply.github.com>
|
| 7 |
+
Requires-Python: >=3.7
|
| 8 |
+
Description-Content-Type: text/markdown
|
| 9 |
+
Classifier: License :: OSI Approved :: MIT License
|
| 10 |
+
Classifier: Operating System :: MacOS
|
| 11 |
+
Classifier: Operating System :: Microsoft :: Windows
|
| 12 |
+
Classifier: Operating System :: POSIX :: Linux
|
| 13 |
+
Classifier: Programming Language :: Python :: 3 :: Only
|
| 14 |
+
Classifier: Programming Language :: Python :: 3.7
|
| 15 |
+
Classifier: Programming Language :: Python :: 3.8
|
| 16 |
+
Classifier: Programming Language :: Python :: 3.9
|
| 17 |
+
Classifier: Programming Language :: Python :: 3.10
|
| 18 |
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
| 19 |
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
| 20 |
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
| 21 |
+
Classifier: Typing :: Typed
|
| 22 |
+
Project-URL: Homepage, https://github.com/executablebooks/mdurl
|
| 23 |
+
|
| 24 |
+
# mdurl
|
| 25 |
+
|
| 26 |
+
[](https://github.com/executablebooks/mdurl/actions?query=workflow%3ATests+branch%3Amaster+event%3Apush)
|
| 27 |
+
[](https://codecov.io/gh/executablebooks/mdurl)
|
| 28 |
+
[](https://pypi.org/project/mdurl)
|
| 29 |
+
|
| 30 |
+
This is a Python port of the JavaScript [mdurl](https://www.npmjs.com/package/mdurl) package.
|
| 31 |
+
See the [upstream README.md file](https://github.com/markdown-it/mdurl/blob/master/README.md) for API documentation.
|
| 32 |
+
|
LTA_openwebtext_dualt/mini_owt_logdirichlet/.venv_qwen35_uv/lib/python3.12/site-packages/mdurl-0.1.2.dist-info/RECORD
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
mdurl-0.1.2.dist-info/INSTALLER,sha256=5hhM4Q4mYTT9z6QB6PGpUAW81PGNFrYrdXMj4oM_6ak,2
|
| 2 |
+
mdurl-0.1.2.dist-info/LICENSE,sha256=fGBd9uKGZ6lgMRjpgnT2SknOPu0NJvzM6VNKNF4O-VU,2338
|
| 3 |
+
mdurl-0.1.2.dist-info/METADATA,sha256=tTsp1I9Jk2cFP9o8gefOJ9JVg4Drv4PmYCOwLrfd0l0,1638
|
| 4 |
+
mdurl-0.1.2.dist-info/RECORD,,
|
| 5 |
+
mdurl-0.1.2.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 6 |
+
mdurl-0.1.2.dist-info/WHEEL,sha256=4TfKIB_xu-04bc2iKz6_zFt-gEFEEDU_31HGhqzOCE8,81
|
| 7 |
+
mdurl/__init__.py,sha256=1vpE89NyXniIRZNC_4f6BPm3Ub4bPntjfyyhLRR7opU,547
|
| 8 |
+
mdurl/_decode.py,sha256=3Q_gDQqU__TvDbu7x-b9LjbVl4QWy5g_qFwljcuvN_Y,3004
|
| 9 |
+
mdurl/_encode.py,sha256=goJLUFt1h4rVZNqqm9t15Nw2W-bFXYQEy3aR01ImWvs,2602
|
| 10 |
+
mdurl/_format.py,sha256=xZct0mdePXA0H3kAqxjGtlB5O86G35DAYMGkA44CmB4,626
|
| 11 |
+
mdurl/_parse.py,sha256=ezZSkM2_4NQ2Zx047sEdcJG7NYQRFHiZK7Y8INHFzwY,11374
|
| 12 |
+
mdurl/_url.py,sha256=5kQnRQN2A_G4svLnRzZcG0bfoD9AbBrYDXousDHZ3z0,284
|
| 13 |
+
mdurl/py.typed,sha256=8PjyZ1aVoQpRVvt71muvuq5qE-jTFZkK-GLHkhdebmc,26
|
LTA_openwebtext_dualt/mini_owt_logdirichlet/.venv_qwen35_uv/lib/python3.12/site-packages/mdurl-0.1.2.dist-info/REQUESTED
ADDED
|
File without changes
|
LTA_openwebtext_dualt/mini_owt_logdirichlet/.venv_qwen35_uv/lib/python3.12/site-packages/mdurl-0.1.2.dist-info/WHEEL
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Wheel-Version: 1.0
|
| 2 |
+
Generator: flit 3.7.1
|
| 3 |
+
Root-Is-Purelib: true
|
| 4 |
+
Tag: py3-none-any
|
LTA_openwebtext_dualt/mini_owt_logdirichlet/.venv_qwen35_uv/lib/python3.12/site-packages/numpy/array_api/tests/__init__.py
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Tests for the array API namespace.
|
| 3 |
+
|
| 4 |
+
Note, full compliance with the array API can be tested with the official array API test
|
| 5 |
+
suite https://github.com/data-apis/array-api-tests. This test suite primarily
|
| 6 |
+
focuses on those things that are not tested by the official test suite.
|
| 7 |
+
"""
|
LTA_openwebtext_dualt/mini_owt_logdirichlet/.venv_qwen35_uv/lib/python3.12/site-packages/numpy/array_api/tests/test_array_object.py
ADDED
|
@@ -0,0 +1,395 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import operator
|
| 2 |
+
|
| 3 |
+
from numpy.testing import assert_raises, suppress_warnings
|
| 4 |
+
import numpy as np
|
| 5 |
+
import pytest
|
| 6 |
+
|
| 7 |
+
from .. import ones, asarray, reshape, result_type, all, equal
|
| 8 |
+
from .._array_object import Array
|
| 9 |
+
from .._dtypes import (
|
| 10 |
+
_all_dtypes,
|
| 11 |
+
_boolean_dtypes,
|
| 12 |
+
_real_floating_dtypes,
|
| 13 |
+
_floating_dtypes,
|
| 14 |
+
_complex_floating_dtypes,
|
| 15 |
+
_integer_dtypes,
|
| 16 |
+
_integer_or_boolean_dtypes,
|
| 17 |
+
_real_numeric_dtypes,
|
| 18 |
+
_numeric_dtypes,
|
| 19 |
+
int8,
|
| 20 |
+
int16,
|
| 21 |
+
int32,
|
| 22 |
+
int64,
|
| 23 |
+
uint64,
|
| 24 |
+
bool as bool_,
|
| 25 |
+
)
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
def test_validate_index():
|
| 29 |
+
# The indexing tests in the official array API test suite test that the
|
| 30 |
+
# array object correctly handles the subset of indices that are required
|
| 31 |
+
# by the spec. But the NumPy array API implementation specifically
|
| 32 |
+
# disallows any index not required by the spec, via Array._validate_index.
|
| 33 |
+
# This test focuses on testing that non-valid indices are correctly
|
| 34 |
+
# rejected. See
|
| 35 |
+
# https://data-apis.org/array-api/latest/API_specification/indexing.html
|
| 36 |
+
# and the docstring of Array._validate_index for the exact indexing
|
| 37 |
+
# behavior that should be allowed. This does not test indices that are
|
| 38 |
+
# already invalid in NumPy itself because Array will generally just pass
|
| 39 |
+
# such indices directly to the underlying np.ndarray.
|
| 40 |
+
|
| 41 |
+
a = ones((3, 4))
|
| 42 |
+
|
| 43 |
+
# Out of bounds slices are not allowed
|
| 44 |
+
assert_raises(IndexError, lambda: a[:4])
|
| 45 |
+
assert_raises(IndexError, lambda: a[:-4])
|
| 46 |
+
assert_raises(IndexError, lambda: a[:3:-1])
|
| 47 |
+
assert_raises(IndexError, lambda: a[:-5:-1])
|
| 48 |
+
assert_raises(IndexError, lambda: a[4:])
|
| 49 |
+
assert_raises(IndexError, lambda: a[-4:])
|
| 50 |
+
assert_raises(IndexError, lambda: a[4::-1])
|
| 51 |
+
assert_raises(IndexError, lambda: a[-4::-1])
|
| 52 |
+
|
| 53 |
+
assert_raises(IndexError, lambda: a[...,:5])
|
| 54 |
+
assert_raises(IndexError, lambda: a[...,:-5])
|
| 55 |
+
assert_raises(IndexError, lambda: a[...,:5:-1])
|
| 56 |
+
assert_raises(IndexError, lambda: a[...,:-6:-1])
|
| 57 |
+
assert_raises(IndexError, lambda: a[...,5:])
|
| 58 |
+
assert_raises(IndexError, lambda: a[...,-5:])
|
| 59 |
+
assert_raises(IndexError, lambda: a[...,5::-1])
|
| 60 |
+
assert_raises(IndexError, lambda: a[...,-5::-1])
|
| 61 |
+
|
| 62 |
+
# Boolean indices cannot be part of a larger tuple index
|
| 63 |
+
assert_raises(IndexError, lambda: a[a[:,0]==1,0])
|
| 64 |
+
assert_raises(IndexError, lambda: a[a[:,0]==1,...])
|
| 65 |
+
assert_raises(IndexError, lambda: a[..., a[0]==1])
|
| 66 |
+
assert_raises(IndexError, lambda: a[[True, True, True]])
|
| 67 |
+
assert_raises(IndexError, lambda: a[(True, True, True),])
|
| 68 |
+
|
| 69 |
+
# Integer array indices are not allowed (except for 0-D)
|
| 70 |
+
idx = asarray([[0, 1]])
|
| 71 |
+
assert_raises(IndexError, lambda: a[idx])
|
| 72 |
+
assert_raises(IndexError, lambda: a[idx,])
|
| 73 |
+
assert_raises(IndexError, lambda: a[[0, 1]])
|
| 74 |
+
assert_raises(IndexError, lambda: a[(0, 1), (0, 1)])
|
| 75 |
+
assert_raises(IndexError, lambda: a[[0, 1]])
|
| 76 |
+
assert_raises(IndexError, lambda: a[np.array([[0, 1]])])
|
| 77 |
+
|
| 78 |
+
# Multiaxis indices must contain exactly as many indices as dimensions
|
| 79 |
+
assert_raises(IndexError, lambda: a[()])
|
| 80 |
+
assert_raises(IndexError, lambda: a[0,])
|
| 81 |
+
assert_raises(IndexError, lambda: a[0])
|
| 82 |
+
assert_raises(IndexError, lambda: a[:])
|
| 83 |
+
|
| 84 |
+
def test_operators():
|
| 85 |
+
# For every operator, we test that it works for the required type
|
| 86 |
+
# combinations and raises TypeError otherwise
|
| 87 |
+
binary_op_dtypes = {
|
| 88 |
+
"__add__": "numeric",
|
| 89 |
+
"__and__": "integer_or_boolean",
|
| 90 |
+
"__eq__": "all",
|
| 91 |
+
"__floordiv__": "real numeric",
|
| 92 |
+
"__ge__": "real numeric",
|
| 93 |
+
"__gt__": "real numeric",
|
| 94 |
+
"__le__": "real numeric",
|
| 95 |
+
"__lshift__": "integer",
|
| 96 |
+
"__lt__": "real numeric",
|
| 97 |
+
"__mod__": "real numeric",
|
| 98 |
+
"__mul__": "numeric",
|
| 99 |
+
"__ne__": "all",
|
| 100 |
+
"__or__": "integer_or_boolean",
|
| 101 |
+
"__pow__": "numeric",
|
| 102 |
+
"__rshift__": "integer",
|
| 103 |
+
"__sub__": "numeric",
|
| 104 |
+
"__truediv__": "floating",
|
| 105 |
+
"__xor__": "integer_or_boolean",
|
| 106 |
+
}
|
| 107 |
+
# Recompute each time because of in-place ops
|
| 108 |
+
def _array_vals():
|
| 109 |
+
for d in _integer_dtypes:
|
| 110 |
+
yield asarray(1, dtype=d)
|
| 111 |
+
for d in _boolean_dtypes:
|
| 112 |
+
yield asarray(False, dtype=d)
|
| 113 |
+
for d in _floating_dtypes:
|
| 114 |
+
yield asarray(1.0, dtype=d)
|
| 115 |
+
|
| 116 |
+
|
| 117 |
+
BIG_INT = int(1e30)
|
| 118 |
+
for op, dtypes in binary_op_dtypes.items():
|
| 119 |
+
ops = [op]
|
| 120 |
+
if op not in ["__eq__", "__ne__", "__le__", "__ge__", "__lt__", "__gt__"]:
|
| 121 |
+
rop = "__r" + op[2:]
|
| 122 |
+
iop = "__i" + op[2:]
|
| 123 |
+
ops += [rop, iop]
|
| 124 |
+
for s in [1, 1.0, 1j, BIG_INT, False]:
|
| 125 |
+
for _op in ops:
|
| 126 |
+
for a in _array_vals():
|
| 127 |
+
# Test array op scalar. From the spec, the following combinations
|
| 128 |
+
# are supported:
|
| 129 |
+
|
| 130 |
+
# - Python bool for a bool array dtype,
|
| 131 |
+
# - a Python int within the bounds of the given dtype for integer array dtypes,
|
| 132 |
+
# - a Python int or float for real floating-point array dtypes
|
| 133 |
+
# - a Python int, float, or complex for complex floating-point array dtypes
|
| 134 |
+
|
| 135 |
+
if ((dtypes == "all"
|
| 136 |
+
or dtypes == "numeric" and a.dtype in _numeric_dtypes
|
| 137 |
+
or dtypes == "real numeric" and a.dtype in _real_numeric_dtypes
|
| 138 |
+
or dtypes == "integer" and a.dtype in _integer_dtypes
|
| 139 |
+
or dtypes == "integer_or_boolean" and a.dtype in _integer_or_boolean_dtypes
|
| 140 |
+
or dtypes == "boolean" and a.dtype in _boolean_dtypes
|
| 141 |
+
or dtypes == "floating" and a.dtype in _floating_dtypes
|
| 142 |
+
)
|
| 143 |
+
# bool is a subtype of int, which is why we avoid
|
| 144 |
+
# isinstance here.
|
| 145 |
+
and (a.dtype in _boolean_dtypes and type(s) == bool
|
| 146 |
+
or a.dtype in _integer_dtypes and type(s) == int
|
| 147 |
+
or a.dtype in _real_floating_dtypes and type(s) in [float, int]
|
| 148 |
+
or a.dtype in _complex_floating_dtypes and type(s) in [complex, float, int]
|
| 149 |
+
)):
|
| 150 |
+
if a.dtype in _integer_dtypes and s == BIG_INT:
|
| 151 |
+
assert_raises(OverflowError, lambda: getattr(a, _op)(s))
|
| 152 |
+
else:
|
| 153 |
+
# Only test for no error
|
| 154 |
+
with suppress_warnings() as sup:
|
| 155 |
+
# ignore warnings from pow(BIG_INT)
|
| 156 |
+
sup.filter(RuntimeWarning,
|
| 157 |
+
"invalid value encountered in power")
|
| 158 |
+
getattr(a, _op)(s)
|
| 159 |
+
else:
|
| 160 |
+
assert_raises(TypeError, lambda: getattr(a, _op)(s))
|
| 161 |
+
|
| 162 |
+
# Test array op array.
|
| 163 |
+
for _op in ops:
|
| 164 |
+
for x in _array_vals():
|
| 165 |
+
for y in _array_vals():
|
| 166 |
+
# See the promotion table in NEP 47 or the array
|
| 167 |
+
# API spec page on type promotion. Mixed kind
|
| 168 |
+
# promotion is not defined.
|
| 169 |
+
if (x.dtype == uint64 and y.dtype in [int8, int16, int32, int64]
|
| 170 |
+
or y.dtype == uint64 and x.dtype in [int8, int16, int32, int64]
|
| 171 |
+
or x.dtype in _integer_dtypes and y.dtype not in _integer_dtypes
|
| 172 |
+
or y.dtype in _integer_dtypes and x.dtype not in _integer_dtypes
|
| 173 |
+
or x.dtype in _boolean_dtypes and y.dtype not in _boolean_dtypes
|
| 174 |
+
or y.dtype in _boolean_dtypes and x.dtype not in _boolean_dtypes
|
| 175 |
+
or x.dtype in _floating_dtypes and y.dtype not in _floating_dtypes
|
| 176 |
+
or y.dtype in _floating_dtypes and x.dtype not in _floating_dtypes
|
| 177 |
+
):
|
| 178 |
+
assert_raises(TypeError, lambda: getattr(x, _op)(y))
|
| 179 |
+
# Ensure in-place operators only promote to the same dtype as the left operand.
|
| 180 |
+
elif (
|
| 181 |
+
_op.startswith("__i")
|
| 182 |
+
and result_type(x.dtype, y.dtype) != x.dtype
|
| 183 |
+
):
|
| 184 |
+
assert_raises(TypeError, lambda: getattr(x, _op)(y))
|
| 185 |
+
# Ensure only those dtypes that are required for every operator are allowed.
|
| 186 |
+
elif (dtypes == "all" and (x.dtype in _boolean_dtypes and y.dtype in _boolean_dtypes
|
| 187 |
+
or x.dtype in _numeric_dtypes and y.dtype in _numeric_dtypes)
|
| 188 |
+
or (dtypes == "real numeric" and x.dtype in _real_numeric_dtypes and y.dtype in _real_numeric_dtypes)
|
| 189 |
+
or (dtypes == "numeric" and x.dtype in _numeric_dtypes and y.dtype in _numeric_dtypes)
|
| 190 |
+
or dtypes == "integer" and x.dtype in _integer_dtypes and y.dtype in _integer_dtypes
|
| 191 |
+
or dtypes == "integer_or_boolean" and (x.dtype in _integer_dtypes and y.dtype in _integer_dtypes
|
| 192 |
+
or x.dtype in _boolean_dtypes and y.dtype in _boolean_dtypes)
|
| 193 |
+
or dtypes == "boolean" and x.dtype in _boolean_dtypes and y.dtype in _boolean_dtypes
|
| 194 |
+
or dtypes == "floating" and x.dtype in _floating_dtypes and y.dtype in _floating_dtypes
|
| 195 |
+
):
|
| 196 |
+
getattr(x, _op)(y)
|
| 197 |
+
else:
|
| 198 |
+
assert_raises(TypeError, lambda: getattr(x, _op)(y))
|
| 199 |
+
|
| 200 |
+
unary_op_dtypes = {
|
| 201 |
+
"__abs__": "numeric",
|
| 202 |
+
"__invert__": "integer_or_boolean",
|
| 203 |
+
"__neg__": "numeric",
|
| 204 |
+
"__pos__": "numeric",
|
| 205 |
+
}
|
| 206 |
+
for op, dtypes in unary_op_dtypes.items():
|
| 207 |
+
for a in _array_vals():
|
| 208 |
+
if (
|
| 209 |
+
dtypes == "numeric"
|
| 210 |
+
and a.dtype in _numeric_dtypes
|
| 211 |
+
or dtypes == "integer_or_boolean"
|
| 212 |
+
and a.dtype in _integer_or_boolean_dtypes
|
| 213 |
+
):
|
| 214 |
+
# Only test for no error
|
| 215 |
+
getattr(a, op)()
|
| 216 |
+
else:
|
| 217 |
+
assert_raises(TypeError, lambda: getattr(a, op)())
|
| 218 |
+
|
| 219 |
+
# Finally, matmul() must be tested separately, because it works a bit
|
| 220 |
+
# different from the other operations.
|
| 221 |
+
def _matmul_array_vals():
|
| 222 |
+
for a in _array_vals():
|
| 223 |
+
yield a
|
| 224 |
+
for d in _all_dtypes:
|
| 225 |
+
yield ones((3, 4), dtype=d)
|
| 226 |
+
yield ones((4, 2), dtype=d)
|
| 227 |
+
yield ones((4, 4), dtype=d)
|
| 228 |
+
|
| 229 |
+
# Scalars always error
|
| 230 |
+
for _op in ["__matmul__", "__rmatmul__", "__imatmul__"]:
|
| 231 |
+
for s in [1, 1.0, False]:
|
| 232 |
+
for a in _matmul_array_vals():
|
| 233 |
+
if (type(s) in [float, int] and a.dtype in _floating_dtypes
|
| 234 |
+
or type(s) == int and a.dtype in _integer_dtypes):
|
| 235 |
+
# Type promotion is valid, but @ is not allowed on 0-D
|
| 236 |
+
# inputs, so the error is a ValueError
|
| 237 |
+
assert_raises(ValueError, lambda: getattr(a, _op)(s))
|
| 238 |
+
else:
|
| 239 |
+
assert_raises(TypeError, lambda: getattr(a, _op)(s))
|
| 240 |
+
|
| 241 |
+
for x in _matmul_array_vals():
|
| 242 |
+
for y in _matmul_array_vals():
|
| 243 |
+
if (x.dtype == uint64 and y.dtype in [int8, int16, int32, int64]
|
| 244 |
+
or y.dtype == uint64 and x.dtype in [int8, int16, int32, int64]
|
| 245 |
+
or x.dtype in _integer_dtypes and y.dtype not in _integer_dtypes
|
| 246 |
+
or y.dtype in _integer_dtypes and x.dtype not in _integer_dtypes
|
| 247 |
+
or x.dtype in _floating_dtypes and y.dtype not in _floating_dtypes
|
| 248 |
+
or y.dtype in _floating_dtypes and x.dtype not in _floating_dtypes
|
| 249 |
+
or x.dtype in _boolean_dtypes
|
| 250 |
+
or y.dtype in _boolean_dtypes
|
| 251 |
+
):
|
| 252 |
+
assert_raises(TypeError, lambda: x.__matmul__(y))
|
| 253 |
+
assert_raises(TypeError, lambda: y.__rmatmul__(x))
|
| 254 |
+
assert_raises(TypeError, lambda: x.__imatmul__(y))
|
| 255 |
+
elif x.shape == () or y.shape == () or x.shape[1] != y.shape[0]:
|
| 256 |
+
assert_raises(ValueError, lambda: x.__matmul__(y))
|
| 257 |
+
assert_raises(ValueError, lambda: y.__rmatmul__(x))
|
| 258 |
+
if result_type(x.dtype, y.dtype) != x.dtype:
|
| 259 |
+
assert_raises(TypeError, lambda: x.__imatmul__(y))
|
| 260 |
+
else:
|
| 261 |
+
assert_raises(ValueError, lambda: x.__imatmul__(y))
|
| 262 |
+
else:
|
| 263 |
+
x.__matmul__(y)
|
| 264 |
+
y.__rmatmul__(x)
|
| 265 |
+
if result_type(x.dtype, y.dtype) != x.dtype:
|
| 266 |
+
assert_raises(TypeError, lambda: x.__imatmul__(y))
|
| 267 |
+
elif y.shape[0] != y.shape[1]:
|
| 268 |
+
# This one fails because x @ y has a different shape from x
|
| 269 |
+
assert_raises(ValueError, lambda: x.__imatmul__(y))
|
| 270 |
+
else:
|
| 271 |
+
x.__imatmul__(y)
|
| 272 |
+
|
| 273 |
+
|
| 274 |
+
def test_python_scalar_construtors():
|
| 275 |
+
b = asarray(False)
|
| 276 |
+
i = asarray(0)
|
| 277 |
+
f = asarray(0.0)
|
| 278 |
+
c = asarray(0j)
|
| 279 |
+
|
| 280 |
+
assert bool(b) == False
|
| 281 |
+
assert int(i) == 0
|
| 282 |
+
assert float(f) == 0.0
|
| 283 |
+
assert operator.index(i) == 0
|
| 284 |
+
|
| 285 |
+
# bool/int/float/complex should only be allowed on 0-D arrays.
|
| 286 |
+
assert_raises(TypeError, lambda: bool(asarray([False])))
|
| 287 |
+
assert_raises(TypeError, lambda: int(asarray([0])))
|
| 288 |
+
assert_raises(TypeError, lambda: float(asarray([0.0])))
|
| 289 |
+
assert_raises(TypeError, lambda: complex(asarray([0j])))
|
| 290 |
+
assert_raises(TypeError, lambda: operator.index(asarray([0])))
|
| 291 |
+
|
| 292 |
+
# bool should work on all types of arrays
|
| 293 |
+
assert bool(b) is bool(i) is bool(f) is bool(c) is False
|
| 294 |
+
|
| 295 |
+
# int should fail on complex arrays
|
| 296 |
+
assert int(b) == int(i) == int(f) == 0
|
| 297 |
+
assert_raises(TypeError, lambda: int(c))
|
| 298 |
+
|
| 299 |
+
# float should fail on complex arrays
|
| 300 |
+
assert float(b) == float(i) == float(f) == 0.0
|
| 301 |
+
assert_raises(TypeError, lambda: float(c))
|
| 302 |
+
|
| 303 |
+
# complex should work on all types of arrays
|
| 304 |
+
assert complex(b) == complex(i) == complex(f) == complex(c) == 0j
|
| 305 |
+
|
| 306 |
+
# index should only work on integer arrays
|
| 307 |
+
assert operator.index(i) == 0
|
| 308 |
+
assert_raises(TypeError, lambda: operator.index(b))
|
| 309 |
+
assert_raises(TypeError, lambda: operator.index(f))
|
| 310 |
+
assert_raises(TypeError, lambda: operator.index(c))
|
| 311 |
+
|
| 312 |
+
|
| 313 |
+
def test_device_property():
|
| 314 |
+
a = ones((3, 4))
|
| 315 |
+
assert a.device == 'cpu'
|
| 316 |
+
|
| 317 |
+
assert all(equal(a.to_device('cpu'), a))
|
| 318 |
+
assert_raises(ValueError, lambda: a.to_device('gpu'))
|
| 319 |
+
|
| 320 |
+
assert all(equal(asarray(a, device='cpu'), a))
|
| 321 |
+
assert_raises(ValueError, lambda: asarray(a, device='gpu'))
|
| 322 |
+
|
| 323 |
+
def test_array_properties():
|
| 324 |
+
a = ones((1, 2, 3))
|
| 325 |
+
b = ones((2, 3))
|
| 326 |
+
assert_raises(ValueError, lambda: a.T)
|
| 327 |
+
|
| 328 |
+
assert isinstance(b.T, Array)
|
| 329 |
+
assert b.T.shape == (3, 2)
|
| 330 |
+
|
| 331 |
+
assert isinstance(a.mT, Array)
|
| 332 |
+
assert a.mT.shape == (1, 3, 2)
|
| 333 |
+
assert isinstance(b.mT, Array)
|
| 334 |
+
assert b.mT.shape == (3, 2)
|
| 335 |
+
|
| 336 |
+
def test___array__():
|
| 337 |
+
a = ones((2, 3), dtype=int16)
|
| 338 |
+
assert np.asarray(a) is a._array
|
| 339 |
+
b = np.asarray(a, dtype=np.float64)
|
| 340 |
+
assert np.all(np.equal(b, np.ones((2, 3), dtype=np.float64)))
|
| 341 |
+
assert b.dtype == np.float64
|
| 342 |
+
|
| 343 |
+
def test_allow_newaxis():
|
| 344 |
+
a = ones(5)
|
| 345 |
+
indexed_a = a[None, :]
|
| 346 |
+
assert indexed_a.shape == (1, 5)
|
| 347 |
+
|
| 348 |
+
def test_disallow_flat_indexing_with_newaxis():
|
| 349 |
+
a = ones((3, 3, 3))
|
| 350 |
+
with pytest.raises(IndexError):
|
| 351 |
+
a[None, 0, 0]
|
| 352 |
+
|
| 353 |
+
def test_disallow_mask_with_newaxis():
|
| 354 |
+
a = ones((3, 3, 3))
|
| 355 |
+
with pytest.raises(IndexError):
|
| 356 |
+
a[None, asarray(True)]
|
| 357 |
+
|
| 358 |
+
@pytest.mark.parametrize("shape", [(), (5,), (3, 3, 3)])
|
| 359 |
+
@pytest.mark.parametrize("index", ["string", False, True])
|
| 360 |
+
def test_error_on_invalid_index(shape, index):
|
| 361 |
+
a = ones(shape)
|
| 362 |
+
with pytest.raises(IndexError):
|
| 363 |
+
a[index]
|
| 364 |
+
|
| 365 |
+
def test_mask_0d_array_without_errors():
|
| 366 |
+
a = ones(())
|
| 367 |
+
a[asarray(True)]
|
| 368 |
+
|
| 369 |
+
@pytest.mark.parametrize(
|
| 370 |
+
"i", [slice(5), slice(5, 0), asarray(True), asarray([0, 1])]
|
| 371 |
+
)
|
| 372 |
+
def test_error_on_invalid_index_with_ellipsis(i):
|
| 373 |
+
a = ones((3, 3, 3))
|
| 374 |
+
with pytest.raises(IndexError):
|
| 375 |
+
a[..., i]
|
| 376 |
+
with pytest.raises(IndexError):
|
| 377 |
+
a[i, ...]
|
| 378 |
+
|
| 379 |
+
def test_array_keys_use_private_array():
|
| 380 |
+
"""
|
| 381 |
+
Indexing operations convert array keys before indexing the internal array
|
| 382 |
+
|
| 383 |
+
Fails when array_api array keys are not converted into NumPy-proper arrays
|
| 384 |
+
in __getitem__(). This is achieved by passing array_api arrays with 0-sized
|
| 385 |
+
dimensions, which NumPy-proper treats erroneously - not sure why!
|
| 386 |
+
|
| 387 |
+
TODO: Find and use appropriate __setitem__() case.
|
| 388 |
+
"""
|
| 389 |
+
a = ones((0, 0), dtype=bool_)
|
| 390 |
+
assert a[a].shape == (0,)
|
| 391 |
+
|
| 392 |
+
a = ones((0,), dtype=bool_)
|
| 393 |
+
key = ones((0, 0), dtype=bool_)
|
| 394 |
+
with pytest.raises(IndexError):
|
| 395 |
+
a[key]
|
LTA_openwebtext_dualt/mini_owt_logdirichlet/.venv_qwen35_uv/lib/python3.12/site-packages/numpy/array_api/tests/test_elementwise_functions.py
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from inspect import getfullargspec
|
| 2 |
+
|
| 3 |
+
from numpy.testing import assert_raises
|
| 4 |
+
|
| 5 |
+
from .. import asarray, _elementwise_functions
|
| 6 |
+
from .._elementwise_functions import bitwise_left_shift, bitwise_right_shift
|
| 7 |
+
from .._dtypes import (
|
| 8 |
+
_dtype_categories,
|
| 9 |
+
_boolean_dtypes,
|
| 10 |
+
_floating_dtypes,
|
| 11 |
+
_integer_dtypes,
|
| 12 |
+
)
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
def nargs(func):
|
| 16 |
+
return len(getfullargspec(func).args)
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
def test_function_types():
|
| 20 |
+
# Test that every function accepts only the required input types. We only
|
| 21 |
+
# test the negative cases here (error). The positive cases are tested in
|
| 22 |
+
# the array API test suite.
|
| 23 |
+
|
| 24 |
+
elementwise_function_input_types = {
|
| 25 |
+
"abs": "numeric",
|
| 26 |
+
"acos": "floating-point",
|
| 27 |
+
"acosh": "floating-point",
|
| 28 |
+
"add": "numeric",
|
| 29 |
+
"asin": "floating-point",
|
| 30 |
+
"asinh": "floating-point",
|
| 31 |
+
"atan": "floating-point",
|
| 32 |
+
"atan2": "real floating-point",
|
| 33 |
+
"atanh": "floating-point",
|
| 34 |
+
"bitwise_and": "integer or boolean",
|
| 35 |
+
"bitwise_invert": "integer or boolean",
|
| 36 |
+
"bitwise_left_shift": "integer",
|
| 37 |
+
"bitwise_or": "integer or boolean",
|
| 38 |
+
"bitwise_right_shift": "integer",
|
| 39 |
+
"bitwise_xor": "integer or boolean",
|
| 40 |
+
"ceil": "real numeric",
|
| 41 |
+
"conj": "complex floating-point",
|
| 42 |
+
"cos": "floating-point",
|
| 43 |
+
"cosh": "floating-point",
|
| 44 |
+
"divide": "floating-point",
|
| 45 |
+
"equal": "all",
|
| 46 |
+
"exp": "floating-point",
|
| 47 |
+
"expm1": "floating-point",
|
| 48 |
+
"floor": "real numeric",
|
| 49 |
+
"floor_divide": "real numeric",
|
| 50 |
+
"greater": "real numeric",
|
| 51 |
+
"greater_equal": "real numeric",
|
| 52 |
+
"imag": "complex floating-point",
|
| 53 |
+
"isfinite": "numeric",
|
| 54 |
+
"isinf": "numeric",
|
| 55 |
+
"isnan": "numeric",
|
| 56 |
+
"less": "real numeric",
|
| 57 |
+
"less_equal": "real numeric",
|
| 58 |
+
"log": "floating-point",
|
| 59 |
+
"logaddexp": "real floating-point",
|
| 60 |
+
"log10": "floating-point",
|
| 61 |
+
"log1p": "floating-point",
|
| 62 |
+
"log2": "floating-point",
|
| 63 |
+
"logical_and": "boolean",
|
| 64 |
+
"logical_not": "boolean",
|
| 65 |
+
"logical_or": "boolean",
|
| 66 |
+
"logical_xor": "boolean",
|
| 67 |
+
"multiply": "numeric",
|
| 68 |
+
"negative": "numeric",
|
| 69 |
+
"not_equal": "all",
|
| 70 |
+
"positive": "numeric",
|
| 71 |
+
"pow": "numeric",
|
| 72 |
+
"real": "complex floating-point",
|
| 73 |
+
"remainder": "real numeric",
|
| 74 |
+
"round": "numeric",
|
| 75 |
+
"sign": "numeric",
|
| 76 |
+
"sin": "floating-point",
|
| 77 |
+
"sinh": "floating-point",
|
| 78 |
+
"sqrt": "floating-point",
|
| 79 |
+
"square": "numeric",
|
| 80 |
+
"subtract": "numeric",
|
| 81 |
+
"tan": "floating-point",
|
| 82 |
+
"tanh": "floating-point",
|
| 83 |
+
"trunc": "real numeric",
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
def _array_vals():
|
| 87 |
+
for d in _integer_dtypes:
|
| 88 |
+
yield asarray(1, dtype=d)
|
| 89 |
+
for d in _boolean_dtypes:
|
| 90 |
+
yield asarray(False, dtype=d)
|
| 91 |
+
for d in _floating_dtypes:
|
| 92 |
+
yield asarray(1.0, dtype=d)
|
| 93 |
+
|
| 94 |
+
for x in _array_vals():
|
| 95 |
+
for func_name, types in elementwise_function_input_types.items():
|
| 96 |
+
dtypes = _dtype_categories[types]
|
| 97 |
+
func = getattr(_elementwise_functions, func_name)
|
| 98 |
+
if nargs(func) == 2:
|
| 99 |
+
for y in _array_vals():
|
| 100 |
+
if x.dtype not in dtypes or y.dtype not in dtypes:
|
| 101 |
+
assert_raises(TypeError, lambda: func(x, y))
|
| 102 |
+
else:
|
| 103 |
+
if x.dtype not in dtypes:
|
| 104 |
+
assert_raises(TypeError, lambda: func(x))
|
| 105 |
+
|
| 106 |
+
|
| 107 |
+
def test_bitwise_shift_error():
|
| 108 |
+
# bitwise shift functions should raise when the second argument is negative
|
| 109 |
+
assert_raises(
|
| 110 |
+
ValueError, lambda: bitwise_left_shift(asarray([1, 1]), asarray([1, -1]))
|
| 111 |
+
)
|
| 112 |
+
assert_raises(
|
| 113 |
+
ValueError, lambda: bitwise_right_shift(asarray([1, 1]), asarray([1, -1]))
|
| 114 |
+
)
|
LTA_openwebtext_dualt/mini_owt_logdirichlet/.venv_qwen35_uv/lib/python3.12/site-packages/numpy/array_api/tests/test_manipulation_functions.py
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from numpy.testing import assert_raises
|
| 2 |
+
import numpy as np
|
| 3 |
+
|
| 4 |
+
from .. import all
|
| 5 |
+
from .._creation_functions import asarray
|
| 6 |
+
from .._dtypes import float64, int8
|
| 7 |
+
from .._manipulation_functions import (
|
| 8 |
+
concat,
|
| 9 |
+
reshape,
|
| 10 |
+
stack
|
| 11 |
+
)
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
def test_concat_errors():
|
| 15 |
+
assert_raises(TypeError, lambda: concat((1, 1), axis=None))
|
| 16 |
+
assert_raises(TypeError, lambda: concat([asarray([1], dtype=int8),
|
| 17 |
+
asarray([1], dtype=float64)]))
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
def test_stack_errors():
|
| 21 |
+
assert_raises(TypeError, lambda: stack([asarray([1, 1], dtype=int8),
|
| 22 |
+
asarray([2, 2], dtype=float64)]))
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
def test_reshape_copy():
|
| 26 |
+
a = asarray(np.ones((2, 3)))
|
| 27 |
+
b = reshape(a, (3, 2), copy=True)
|
| 28 |
+
assert not np.shares_memory(a._array, b._array)
|
| 29 |
+
|
| 30 |
+
a = asarray(np.ones((2, 3)))
|
| 31 |
+
b = reshape(a, (3, 2), copy=False)
|
| 32 |
+
assert np.shares_memory(a._array, b._array)
|
| 33 |
+
|
| 34 |
+
a = asarray(np.ones((2, 3)).T)
|
| 35 |
+
b = reshape(a, (3, 2), copy=True)
|
| 36 |
+
assert_raises(AttributeError, lambda: reshape(a, (2, 3), copy=False))
|
| 37 |
+
|
LTA_openwebtext_dualt/mini_owt_logdirichlet/.venv_qwen35_uv/lib/python3.12/site-packages/numpy/array_api/tests/test_sorting_functions.py
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import pytest
|
| 2 |
+
|
| 3 |
+
from numpy import array_api as xp
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
@pytest.mark.parametrize(
|
| 7 |
+
"obj, axis, expected",
|
| 8 |
+
[
|
| 9 |
+
([0, 0], -1, [0, 1]),
|
| 10 |
+
([0, 1, 0], -1, [1, 0, 2]),
|
| 11 |
+
([[0, 1], [1, 1]], 0, [[1, 0], [0, 1]]),
|
| 12 |
+
([[0, 1], [1, 1]], 1, [[1, 0], [0, 1]]),
|
| 13 |
+
],
|
| 14 |
+
)
|
| 15 |
+
def test_stable_desc_argsort(obj, axis, expected):
|
| 16 |
+
"""
|
| 17 |
+
Indices respect relative order of a descending stable-sort
|
| 18 |
+
|
| 19 |
+
See https://github.com/numpy/numpy/issues/20778
|
| 20 |
+
"""
|
| 21 |
+
x = xp.asarray(obj)
|
| 22 |
+
out = xp.argsort(x, axis=axis, stable=True, descending=True)
|
| 23 |
+
assert xp.all(out == xp.asarray(expected))
|
LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr3e3_ema0p9999_elfopt_not5_bottleneck16_unfixed_norm_stateprobadd_selfcond_ce_fast_20260612_030202/step_048000.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:75843c3b596269b18da6b923e5399bf65274a4ae7779089b11b2b409213b0fc3
|
| 3 |
+
size 897562466
|
LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr3e3_ema0p9999_elfopt_not5_bottleneck16_unfixed_norm_stateprobadd_selfcond_ce_fast_20260612_030202/step_314000.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:24e783cd9b017bf6f3361e443e8423254efde74c890757cd1a8ebdcc002aa4ed
|
| 3 |
+
size 897562466
|
LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr3e3_ema0p9999_elfopt_not5_bottleneck16_unfixed_norm_stateprobadd_selfcond_ce_fast_20260612_030202/step_319000.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b6c4e62b768d1304fe8bf7539bedf44d64ddf66d2939283c6ebdd3991f9eb029
|
| 3 |
+
size 897562466
|
LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr3e3_ema0p9999_elfopt_not5_bottleneck256_unfixed_norm_stateprobadd_selfcond_ce_fast_20260612_050225/step_013000.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:dc0d92331e1283aee66967c33006d7be34a6ec09e99974caf16ec22b0d7152e5
|
| 3 |
+
size 962143586
|
LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr3e3_ema0p9999_elfopt_not5_bottleneck256_unfixed_norm_stateprobadd_selfcond_ce_fast_20260612_050225/step_240000.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4fdc9185173c577bafc1e463f13f18d5e3baa8866d7510cc8753799ce1c3ebcc
|
| 3 |
+
size 962143586
|
LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr3e3_ema0p9999_elfopt_not5_bottleneck256_unfixed_norm_stateprobadd_selfcond_ce_fast_20260612_050225/step_241000.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d0f955bd3fb386641917a660c633bdccf70d4fed9f6b8aaa823b22151546de9e
|
| 3 |
+
size 962143586
|
LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr3e3_ema0p9999_elfopt_not5_bottleneck256_unfixed_norm_stateprobadd_selfcond_ce_fast_20260612_050225/step_498000.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e45b3c04d8f309aafa2f8c719fafc2ba6e8d6c482b15226a0fbee923aba5dad2
|
| 3 |
+
size 962143586
|
LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr3e3_ema0p9999_elfopt_not5_bottleneck256_unfixed_norm_stateprobadd_selfcond_ce_fast_20260612_050225/step_520000.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3052e3060f0debc4241bcade51ba134bb004d4f64522ace0f16bb080e4b5763e
|
| 3 |
+
size 962143586
|