o
     i                     @   s0  d dl Z d dlZd dlmZ d dlmZ d dlmZ defddZ	e
dkre	 Ze d	Zejd
ddd ejdddd ejdddee d ejddddd eD d ejddedd e ZejD ]-ZejD ]%Zedde de dej  d ej d!e d!e  d"ej   qmqhdS dS )#    N)Path)Task)ATTENTION_REGISTRYreturnc                  C   s*   ddg} | D ]}t | r|  S qdS )Nz/checkpointz/checkpoints.)r   is_dir)checkpoint_pathscheckpoint_path r
   X/home/ubuntu/.local/lib/python3.10/site-packages/xformers/benchmarks/LRA/batch_submit.pyget_default_shared_folder   s   r   __main__zDBenchmark different attention mechanisms on various sequence lengthsz-cz--config_pathT)requiredz-ckz--checkpoint_pathz-az--attentions+)nargsdefaultz-tz--tasksc                 C   s   g | ]}|j qS r
   )value).0tr
   r
   r   
<listcomp>$   s    r   z--partitiona100zPartition where to submit)r   typehelpzpython3 run_with_submitit.pyz --attention z	  --task z
 --config z --checkpoint_dir /z --partition )argparseospathlibr   !xformers.benchmarks.LRA.run_tasksr   xformers.components.attentionr   strr   __name__default_checkpoint_pathArgumentParserparseradd_argumentlistkeys
parse_argsargs
attentions	attentiontaskstasksystemconfig_pathr	   	partitionr
   r
   r
   r   <module>   sF   	


