+
    \åûjÊS  ã                   óŽ  € ^ RI t ^ RIHtHt ^ RIHtHt ^ RIt^ RI	H
t
 ^ RIHt ^ RIHtHt ^RIHtHtHt ]'       d   ^RIHt . ROt]
! R
R7      R R l4       t]
! R
R7      R R l4       t]
! R
R7      ] ! R R	4      4       4       t]
! R
R7      R
R
]P4                  P6                  3R R ll4       t]
! R
R7      R R l4       tR# )é    N)Ú	dataclassÚfield)ÚAnyÚTYPE_CHECKING)Úcompatibility)Úmap_arg)ÚHolderModuleÚlift_subgraph_as_module)ÚCALLABLE_NODE_OPSÚis_node_output_tensorÚNodeList)ÚSubgraphÚ	ComponentF)Úis_backward_compatiblec                ó<   € V ^8„  d   QhR\         R\        R\        /# )é   ÚobjÚnameÚreturn)ÚobjectÚstrr   )Úformats   "ÚWC:\Ai_Coding\apps\studio\ComfyUI\.venv\Lib\site-packages\torch\fx\passes\split_utils.pyÚ__annotate__r      s!   € ÷ ñ œ6ð ¬ð ´ñ ó    c                 ó<  € VP                  R 4       F†  p\        V \        P                  P                  4      '       d;   \        V R4      '       d&   W P                  9   d   V P                  V,          p Kd   R# \        W4      '       d   \        W4      p K…   R# 	  V # )Ú.Ú_modulesN)ÚsplitÚ
isinstanceÚtorchÚnnÚ
ModuleListÚhasattrr   Úgetattr)r   r   Úlayers   && r   Úgetattr_recursiver'      sq   € à—‘˜C–ˆÜ�cœ5Ÿ8™8×.Ñ.×/Ò/Ü�s˜J×'Ò'¨E·\±\Ô,AØ—l‘l 5Õ)’âÜ�S× Ò Ü˜#Ó%ŠCâñ !ð €Jr   c                ó@   € V ^8„  d   QhR\         R\        R\         RR/# )r   r   ÚattrÚvaluer   N)r   r   )r   s   "r   r   r   *   s.   € ÷ Nñ Nœ6ð N¬ð N´Vð NÀñ Nr   c                 ó¸   € R V9  d   \        WV4       R# VP                  R 4      p\        \        W^ ,          4      R P	                  VR,          4      V4       R# )r   :é   NNN)Úsetattrr   Úsetattr_recursiver%   Újoin)r   r)   r*   r&   s   &&& r   r.   r.   )   sB   € à
�$„Ü�˜5Ö!à—
‘
˜3“ˆÜœ' #¨Q¥xÓ0°#·(±(¸5À½9Ó2EÀuÖMr   c                   óŽ   a € ] tR t^2t o Rt]! ]R7      t]! ]R7      t]! ]R7      t	]! ]
R7      t]! ]R7      tRtV 3R ltRtV tR# )r   zP
A component serves as a container for a subgraph we want to create afterwards.
)Údefault_factoryNc                ó  <€ V ^8„  d   Qh/ S[ P                  P                  ;R&   S[;R&   S[;R&   S[S[ P                  P                  ,          ;R&   S[S[ P                  P                  ,          ;R&   S[S[ P                  P                  ,          ;R&   S[S[ P                  P                  S[ P                  P                  3,          ;R&   S[S[,          ;R&   S[ P                  P                  R	,          ;R
&   # )r   ÚgraphÚorderr   Úinput_placeholdersÚorig_inputsÚorig_outputsÚgetattr_mapsÚconstructor_argsNÚgm)	r!   ÚfxÚGraphÚintr   ÚlistÚNodeÚdictÚGraphModule)r   Ú__classdict__s   "€r   r   ÚComponent.__annotate__2   sÔ   ø‡ ‚ ñ �8‰8�>‰>Ññ ñ �Jñ ñ �Iñ ñ ™UŸX™XŸ]™]Õ+ÑIñ ñ ‘e—h‘h—m‘mÕ$ÑBñ ñ$ ‘u—x‘x—}‘}Õ%ÑCñ% ñ* ‘u—x‘x—}‘}¡e§h¡h§m¡mÐ3Õ4ÑRñ+ ñ, ™3•iÑ=ñ- ñ. 	�‰×Ñ˜tÕ#Ñ*ò/ r   © )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r>   r5   r6   r7   r@   r8   r9   r:   Ú__annotate_func__Ú__static_attributes__Ú__classdictcell__)rB   s   @r   r   r   2   sR   ø‡ € ññ /4ÀDÔ.IÐñ (-¸TÔ'B€Kñ ).¸dÔ(C€Lñ 8=ÈTÔ7R€LÙ"'¸Ô"=ÐØ&*€B÷/ ƒ r   c                ó†  € V ^8„  d   QhR\         P                  P                  R\        \        ,          R\
        R\
        R\        \         P                  P                  ,          R\         P                  P                  \        \         P                  P                  \        \        \        3,          3,          ,          /# )r   r:   ÚtagsÚreturn_fqn_mappingÚreturn_tupleÚGraphModuleClsr   )	r!   r;   rA   r>   r   ÚboolÚtypeÚtupler@   )r   s   "r   r   r   M   s”   € ÷ Jñ JÜ�‰×ÑðJä
Œs�)ðJô ðJô ð	Jô
 œŸ™×-Ñ-Õ.ðJô ‡X�X×ÑœE¤%§(¡(×"6Ñ"6¼¼SÄ#¸X½Ð"FÕGÕGñJr   c           
     óT  aaaa€ R R lp/ o/ o/ p. p/ o\         P                  P                  4       p/ p	Rp
V FK  p\        \         P                  P                  4       \	        V4      V 4      oVP                  S4       SWk&   KM  	  V P                  P                   EFÉ  pVP                  R8X  d   V
e   \        R4      hTp
K(  VP                  R8X  dW   VP                  VP                  VP                  R7      Wœ&   \        P                  ! VP                  4      Wœ,          n        K�  VP                  R8X  d   K¢  \        VR	4      '       g   \!        R
VP#                  4        24      hV! VP$                  4      V! VP&                  4      ,            Uu. uF  pVP                  R9  g   K  SV,          NK!  	  ppWlP(                  ,          oSSV&   \+        R V 4       ^ R7      pSP,                  V8  d)   \!        RSP                   RSP,                   RV 24      hR VVVV3R llpSP                  P/                  VV4      pVP(                  Vn        VSV&   SSV&   EKÌ  	  V
f   \        R4      hV! V
P$                  ^ ,          4       FD  pVP                  R8X  d,   VP1                  VP                  VP                  R7      W�&   K?  RSV&   KF  	  S F8  pVP                  R8w  g   K  SV,          P2                  P                  V4       K:  	  / pV EFˆ  o\5        \7        SP8                  SP2                  4      4      pV'       d   SP                  P;                  V4       M4SP                  P;                  \	        V4      ^8X  d
   V^ ,          MT4       \=        V SP                  SP                  R7      w  Sn        pVPA                  V4       VPC                  SP                  \5        \7        V	P8                  SPD                  4      4      RR7      p\	        V4      ^8X  d"   V'       g   VV	SP2                  ^ ,          &   EK6  \G        SP2                  4       F9  w  pp\         P                  PI                  V4      V,          PJ                  V	V&   K;  	  EK‹  	  VP;                  \M        V
P$                  ^ ,          V	P8                  4      4       \O        V Uu/ uF  pVP                  VP>                  bK  	  up4      pV P                  PP                  Vn(        V! V
P$                  ^ ,          4       F@  pVP                  R8X  g   K  \S        VVP                  \U        WPV                  4      4       KB  	  V! VV4      pV'       d   VV3# V# u upi u upi )an  
Splits a GraphModule using tags on its graph nodes. We honor the order of
tags. For example, we have tags = ["a", "b", "c"], the function will create
the initial submodules in the order of "a", "b", "c".

To set a tag:

.. code-block:: python

    gm.graph.nodes[idx].tag = "mytag"

This will result in all nodes with the same tag being extracted and placed in their
own submodule. For placeholder, output and get_attr node, the tag is ignored. placeholder
and output nodes are created when needed while get_attr nodes get copied to submodules
where they are used.

Given the following module def:

.. code-block:: python

    class SimpleModule(torch.nn.Module):
        def __init__(self) -> None:
            super().__init__()
            self.linear1 = torch.nn.Linear(...)
            self.linear2 = torch.nn.Linear(...)
            self.linear3 = torch.nn.Linear(...)

        def forward(self, in1, in2):
            r1 = self.linear1(in1)
            r2 = self.linear2(in2)
            r3 = torch.cat([r1, r2])
            return self.linear3(r3)

Marking the node corresponding to in1 with the tag sc.REQUEST_ONLY.lower() results in the following split:

ro:

.. code-block:: python

    def forward(self, in1):
        self = self.root
        linear1 = self.linear1(in1)
        return linear1

main:

.. code-block:: python

    def forward(self, in2, linear1):
        self = self.root
        linear2 = self.linear2(in2)
        cat_1 = torch.cat([linear1, linear2])
        linear3 = self.linear3(cat_1)
        return linear3

main:

.. code-block:: python

    def forward(self, in1, in2):
        self = self.root
        ro_0 = self.ro_0(in1)
        main_1 = self.main_1(in2, ro_0)
        return main_1

Returns:
    split_gm: torch fx graph after split

    orig_to_split_fqn_mapping: a map between the original fqn and the fqn
        after split for call_module and get_attr.
c                ól   € V ^8„  d   QhR\         P                  P                  P                  R\        /# ©r   Úxr   )r!   r;   ÚnodeÚArgumentr   )r   s   "r   r   Ú#split_by_tags.<locals>.__annotate__œ   s(   € ÷ ñ ”5—8‘8—=‘=×)Ñ)ð ¬hñ r   c                ó4   € . p\        WP                  4       V# )z3
Stores nodes in x to a list and returns the list.
)r   Úappend)rX   Úrs   & r   ÚflattenÚsplit_by_tags.<locals>.flattenœ   s   € ð ˆÜ�—8‘8ÔØˆr   NÚoutputzMultiple output nodes in graph!Úplaceholder©Ú	type_exprÚget_attrÚtagzNode does not have tag: c              3   ó8   "  € T F  qP                   x € K  	  R # 5i©N)r4   )Ú.0Úcs   & r   Ú	<genexpr>Ú split_by_tags.<locals>.<genexpr>å   s   é € Ð7Ñ#6˜a—'–'Ó#6ùs   ‚)Údefaultz
Component z8 order must be >= max of its upstream components, order=z	 and max=c                ó€   € V ^8„  d   QhR\         P                  P                  R\         P                  P                  /# rW   ©r!   r;   r?   )r   s   "r   r   r[   ï   s.   € ÷ 	Fñ 	Fœ%Ÿ(™(Ÿ-™-ð 	F¬E¯H©H¯M©Mñ 	Fr   c                 óÄ  <€ V P                   R 8X  dÚ   \        V P                  \        4      '       g"   \	        R\        V P                  4       24      hV SP                  9  du   SP                  P                  V P                  V P
                  R7      SP                  V &   \        P                  ! V P                  4      SP                  V ,          n
        SP                  V ,          # V P                   R8w  d   SV ,          S8X  d
   SV ,          # V SP                  9  d’   SP                  P                  V 4       SP                  P                  V P                  V P
                  R7      p\        P                  ! V P                  4      Vn
        SP                  P                  V4       RSV &   SP                  SP                  P!                  V 4      ,          # )re   z/Expected get_attr node target to be a str, got rc   rb   N)Úopr    Útargetr   ÚRuntimeErrorrS   r8   r3   re   ÚcopyÚmetar6   r]   rb   r   r5   Úindex)rX   rb   ÚcompÚnode_remappingÚnode_to_componentÚused_in_mains   & €€€€r   Ú
remap_funcÚ!split_by_tags.<locals>.remap_funcï   su  ø€ ð �t‰t�zÔ!Ü! !§(¡(¬C×0Ò0Ü&ØIÌ$ÈqÏxÉxË.ÐIYÐZóð ð ˜D×-Ñ-Ô-Ø+/¯:©:×+>Ñ+>ØŸ™¨A¯F©Fð ,?ó ,�D×%Ñ% aÑ(ô 15·	²	¸!¿&¹&Ó0A�D×%Ñ% aÕ(Ô-Ø×(Ñ(¨Õ+Ð+ð
 �t‰t�}Ô$Ð):¸1Õ)=ÀÔ)EØ% aÕ(Ð(ð ˜×(Ñ(Ô(Ø× Ñ ×'Ñ'¨Ô*Ø"Ÿj™j×4Ñ4°Q·V±VÀqÇvÁvÐ4ÓN�Ü#'§9¢9¨Q¯V©VÓ#4�Ô Ø×'Ñ'×.Ñ.¨{Ô;Ø"&�˜Q‘à×*Ñ*¨4×+;Ñ+;×+AÑ+AÀ!Ó+DÕEÐEr   zGraph had no output node!)ÚsubgraphÚ	comp_name)ÚargsÚkwargs>   re   rb   ),r!   r;   r<   r   Úlenr]   r3   Únodesrq   rs   rb   r   rS   rt   ru   r$   ÚAssertionErrorÚformat_noder   r€   rf   Úmaxr4   Ú	node_copyre   r7   rT   ÚmapÚ__getitem__ra   r
   r:   ÚupdateÚcall_moduler6   Ú	enumerateÚProxyrY   r   r	   Ú_codegenr-   r'   rr   )r:   rN   rO   rP   rQ   r_   Útag_to_componentÚall_componentsÚmain_gÚmain_remappingÚoutput_noderf   rY   rX   Úupstream_componentsÚmxr{   ÚnÚorig_to_split_fqn_mappingÚoutsÚcomp_orig_to_split_fqn_mappingÚ	main_nodeÚiÚorw   Ú	main_rootÚ	result_gmrx   ry   rz   s   &&&&&                   `  @@@r   Úsplit_by_tagsrž   L   sî  û€ õ`ð :<€Nð 9;Ðð .0Ðð ')€Nð /1€Lô �X‰X�^‰^Ó€Fð :<€Nð )-€Kó ˆÜœŸ™Ÿ™Ó)¬3¨~Ó+>À3À%ÓIˆØ×Ñ˜dÔ#Ø $ÐÓñ ð —‘—•ˆØ�7‰7�hÔØÒ&Ü"Ð#DÓEÐEØˆKÙð �7‰7�mÔ#Ø#)×#5Ñ#5°d·i±iÈ4Ï9É9Ð#5Ó#UˆNÑ Ü(,¯	ª	°$·)±)Ó(<ˆNÕ Ô%Ùð �7‰7�jÔ Ùô �t˜U×#Ò#Ü Ð#;¸D×<LÑ<LÓ<NÐ;OÐ!PÓQÐQñ ˜TŸY™YÓ'©'°$·+±+Ó*>Ö>ó
á>�Ø�t‰tÐ6Ñ6ô !Ð˜a× Ð Ù>ð 	ð 
ð  §¡Õ)ˆØ"&Ð˜$Ñô Ñ7Ñ#6Ó7ÀÔCˆð �:‰:˜Œ?Ü Ø˜TŸY™Y˜Kð (ØŸ™˜ I¨b¨Tð3óð ÷	Fó 	Fð@ �J‰J× Ñ   zÓ2ˆØ—‘ˆŒØ ˆ�tÑØ#Ð˜!Ôñ] ð` ÒÜÐ6Ó7Ð7á�[×%Ñ% aÕ(Ö)ˆØ�4‰4�:Ôð !'§¡°·±À!Ç&Á& Ó IˆNÓð #ˆL˜‹Oñ *ó ˆØ�4‰4�=Ö Ø˜aÕ ×-Ñ-×4Ñ4°QÖ7ñ ð
 13ÐÜˆÜ”S˜×3Ñ3°T×5FÑ5FÓGÓHˆçØ�J‰J×Ñ˜dÕ#ð �J‰J×Ñ¬¨T«°a¬˜d 1žg¸TÔBä2IØ˜Ÿ™¨t¯y©yô3
Ñ/ˆŒÐ/ð 	"×(Ñ(Ð)GÔHð ×&Ñ&Ø�I‰IÜ”s˜>×5Ñ5°t×7GÑ7GÓHÓIØð 'ó 
ˆ	ô ˆt‹9˜Œ>§,Ø3<ˆN˜4×,Ñ,¨QÕ/Ô0ä! $×"3Ñ"3Ö4‘��1ä$)§H¡H§N¡N°9Ó$=¸aÕ$@×$EÑ$E�˜qÓ!ô 5ñ7 ð> ‡M�M”'˜+×*Ñ*¨1Õ-¨~×/IÑ/IÓJÔKÜ¹^ÓL¹^°T˜dŸi™i¨¯©Ò0¹^ÑLÓM€IØ—h‘h×'Ñ'€F„Oñ �[×%Ñ% aÕ(Ö)ˆØ�4‰4�:ÖÜ�I˜qŸv™vÔ'8¸¿X¹XÓ'FÖGñ *ñ ˜y¨&Ó1€IßØÐ3Ð3Ð3àÐùòy
ùò^ Ms   ÆV Æ1V Ó* V%c                ó6   € V ^8„  d   QhR\         R,          RR/# )r   Ú	subgraphsr   r   N)r>   )r   s   "r   r   r   [  s#   € ÷ C-ñ C-´°jÕ1Að C-Àdñ C-r   c                óä  aa€ / o\        V 4       F  w  rVP                   F  pVSV&   K
  	  K  	  R V3R lloR V3R llpR VV3R llpR VV3R llp\        V 4       EF‰  w  rrVP                  '       g   K  . p\        4       p	VP                   F7  p\	        V4      '       d   K  V! W74      '       g   K&  VP                  V4       K9  	  V'       g   Kw  VP                  ^ 4      p
W©9   d   K#  V	P                  V
4       V
S9  g   SV
,          V8w  d   KK  S! V
4      p\        V4      ^ 8X  d   \        R	4      h\        4       pV F%  pSV,          pWç8w  g   K  VP                  V4       K'  	  \        V4      ^8w  d   \        R
V
P                   R24       KÎ  VP                  4       pV! W§V4      w  ppV'       g   Kô  V F£  pVP                  P                  V4       W,          P                  P                  V4       VSV&   \        RV
P                   RVP                   RVP                  '       d   RMR RT RW,          P                  '       d   RMR RV 24       K¥  	  V! V
4      pV Fq  p\	        V4      '       d   K  VV	9  g   K  VS9   g   K(  SV,          V8X  g   K8  V! VV4      '       g   \        RVP                   R24      hVP                  V4       Ks  	  EK  	  R# )aË  
Move non-tensor nodes on the boundary between subgraphs.

For each subgraph:

1. Find nodes whose type is not tensor and any of its children is in another
   subgraph, put them in a queue for next step

2. Do a BFS on those nodes in the queue,  and run a DFS for each node, let's say node X and it is in subgraph A:

   a. if it is in to_subgraph, return (continue DFS)
   b. if it is in from_subgraph, collect the nodes to nodes_to_move, and continue DFS
   c. otherwise, this means it cannot be moved
   d. also check if node X's parent should be put into the queue. (The queue may
      have duplicated nodes, just process the node once)

Args:
    subgraphs: List of subgraphs containing nodes to be processed
c                ó–   € V ^8„  d   QhR\         P                  P                  R\        \         P                  P                  ,          /# ©r   rY   r   ©r!   r;   r?   r>   )r   s   "r   r   Ú7move_non_tensor_nodes_on_boundary.<locals>.__annotate__u  s/   € ÷ 
ñ 
¤E§H¡H§M¡Mð 
´d¼5¿8¹8¿=¹=Õ6Iñ 
r   c                ó†   <€ V P                    Uu. uF%  pVP                  \        9   g   K  VS9   g   K#  VNK'  	  up# u upi )z@Get children nodes that are in callable ops and in some subgraph)Úusersrq   r   )rY   ÚuserÚnode_to_subgraphs   & €r   Úget_children_in_graphÚ@move_non_tensor_nodes_on_boundary.<locals>.get_children_in_graphu  sK   ø€ ð Ÿ
š
ó
á"�Ø�w‰wÔ+Ñ+ô à04Ð8HÑ0H÷ ˆDÙ"ñ
ð 	
ùò 
ó   �>¬>µ>c                ó–   € V ^8„  d   QhR\         P                  P                  R\        \         P                  P                  ,          /# r£   r¤   )r   s   "r   r   r¥   }  s/   € ÷ 
ñ 
¤5§8¡8§=¡=ð 
´T¼%¿(¹(¿-¹-Õ5Hñ 
r   c                ó†   <€ V P                    Uu. uF%  pVP                  \        9   g   K  VS9   g   K#  VNK'  	  up# u upi )z>Get parent nodes that are in callable ops and in some subgraph)Úall_input_nodesrq   r   )rY   Úargr©   s   & €r   Úget_parents_in_graphÚ?move_non_tensor_nodes_on_boundary.<locals>.get_parents_in_graph}  sM   ø€ ð ×+Ò+ó
á+�Ø�v‰vÔ*Ñ*ô à/2Ð6FÑ/F÷ ˆCÙ+ñ
ð 	
ùò 
r¬   c                ód   € V ^8„  d   QhR\         P                  P                  R\        R\        /# )r   rY   Úcurrent_subgraph_idxr   )r!   r;   r?   r=   rR   )r   s   "r   r   r¥   …  s,   € ÷ 

ñ 

Ü�h‰h�m‰mð

Ü36ð

ä	ñ

r   c                óŽ   <a€ S! V 4      p\         ;QJ d     VV3R lV 4       F  '       g   K   R# 	  R# ! VV3R lV 4       4      # )z�
Check if the node has any children in a subgraph different from current_subgraph_idx.
This is the requirement used in both step 1 and step d.
c              3   ó<   <"  € T F  pSV,          S8g  x € K  	  R # 5irh   rD   )ri   Úchildr´   r©   s   & €€r   rk   Ú\move_non_tensor_nodes_on_boundary.<locals>.has_children_in_other_subgraph.<locals>.<genexpr>�  s    øé € ð 
ÙIQÀÐ˜UÕ#Ð';Ö;Ëùs   ƒTF)Úany)rY   r´   Úchildrenrª   r©   s   &f €€r   Úhas_children_in_other_subgraphÚImove_non_tensor_nodes_on_boundary.<locals>.has_children_in_other_subgraph…  sJ   ù€ ñ )¨Ó.ˆß‹sõ 
ÙIQó
�sŒsð 	
Šsð 	
ˆsõ 
ÙIQó
ó 
ð 	
r   c                óÐ   € V ^8„  d   QhR\         P                  P                  R\        R\        R\        \
        \        \         P                  P                  ,          3,          /# )r   rY   Úfrom_subgraphÚto_subgraphr   )r!   r;   r?   r=   rT   rR   Úset)r   s   "r   r   r¥   ‘  sK   € ÷ 1'ñ 1'Ü�h‰h�m‰mð1'Ü,/ð1'Ü>Að1'ä	Œt”SœŸ™Ÿ™Õ'Ð'Õ	(ñ1'r   c           	     ót   <aaaaaa€ \        4       o\        4       oRoR VVVVVVVV3R lloS! V 4       SS3# )a]  
Check if node and its dependencies can be moved from from_subgraph to to_subgraph.
Returns (can_move, nodes_to_move)

For node X, do a DFS on its descendants, for each node:
- if it is in to_subgraph, return (continue DFS)
- if it is in from_subgraph, collect the nodes to nodes_to_move, and continue DFS
- otherwise, this means it cannot be moved
Tc                óP   € V ^8„  d   QhR\         P                  P                  RR/# )r   Úcurrent_noder   Nro   )r   s   "r   r   Ú_move_non_tensor_nodes_on_boundary.<locals>.can_move_node_and_dependencies.<locals>.__annotate__¡  s"   € ÷ 	ñ 	œeŸh™hŸm™mð 	°ñ 	r   c                 óò   <€ V S9   d   R # SP                  V 4       V S9  d   R # SV ,          pVS
8X  d   R # VS8X  d   S	P                  V 4       MRoR # S! V 4      pV F  pS'       g   K  S! V4       K  	  R # )NF)Úadd)rÃ   Úcurrent_subgraphrº   r·   Úcan_moveÚdfsr¾   rª   r©   Únodes_to_mover¿   Úvisiteds   &   €€€€€€€€r   rÉ   ÚVmove_non_tensor_nodes_on_boundary.<locals>.can_move_node_and_dependencies.<locals>.dfs¡  s‚   ø€ ð ˜wÔ&ÙØ�K‰K˜Ô%ð Ð#3Ô3Ùà/°Õ=Ðà ;Ô.áØ! ]Ô2à×!Ñ! ,Õ/ð !�Ùñ -¨\Ó:ˆHÛ!�ß‘8Ù˜–Jó "r   )rÀ   )	rY   r¾   r¿   rÈ   rÉ   rÊ   rË   rª   r©   s	   &ff@@@@€€r   Úcan_move_node_and_dependenciesÚImove_non_tensor_nodes_on_boundary.<locals>.can_move_node_and_dependencies‘  s6   þ€ ô ›ˆÜ“%ˆØˆ÷	÷ 	ñ> 	ˆDŒ	à˜Ð&Ð&r   z:Only node that has children in other subgraph can be movedzCannot move non-tensor node z: on boundary because it has children in multiple subgraphsz%In order to move the non-tensor node z on boundary, moved node z from ÚaccÚgpuÚ_z to zParent z) should have children in another subgraphN)r‹   r‚   Úis_accrÀ   r   r]   ÚpoprÆ   r�   rƒ   Úprintr   Úremove)r    rš   r}   rY   r±   r»   rÍ   Úsubgraph_idxÚqueueÚ	processedrÃ   rº   Útarget_subgraph_candidatesr·   Úchild_subgraphÚtarget_subgraphrÈ   rÊ   Únode_to_moveÚparentsÚparentrª   r©   s   &                    @@r   Ú!move_non_tensor_nodes_on_boundaryrß   Z  sä  ù€ ð, 24ÐÜ  Ö+‰ˆØ—N”NˆDØ%&Ð˜TÓ"ó #ñ ,÷
ð 
÷
ð 
÷

ñ 

÷1'ñ 1'ôh #,¨I×"6Ñˆà��ˆÙà%'ˆÜ(+«ˆ	à—N”NˆDä$ T×*Ò*Ùñ .¨d×AÔAØ—‘˜TÖ"ñ #÷ ‰eØ Ÿ9™9 Q›<ˆLð Ô(ÙØ�M‰M˜,Ô'ð Ð$4Ô4Ø# LÕ1°\ÔAáá,¨\Ó:ˆHÜ�8‹} Ô!Ü$ØPóð ô
 *-«Ð&Û!�Ø!1°%Õ!8�Ø!Ö1Ø.×2Ñ2°>ÖBñ "ô
 Ð-Ó.°!Ô3ÜØ2°<×3DÑ3DÐ2EÐEð  Aôñ à8×<Ñ<Ó>ˆOñ 'EØ¨Oó'Ñ#ˆH�m÷ ‰xã$1�Là—N‘N×)Ñ)¨,Ô7àÕ.×4Ñ4×;Ñ;¸LÔIà5DÐ$ \Ñ2ÜØ?À×@QÑ@QÐ?Rð S&Ø&2×&7Ñ&7Ð%8¸ÈÏÏÈ¹uÐ]bÐ>cÐcdÐeqÐdrð sØ'0Õ'A×'H×'HÐ'H™eÈeÐTÐTUÐVeÐUfðhöñ %2ñ /¨|Ó<�Û%�Fä1°&×9Ô9Ø"¨)Ö3Ø"Ð&6Ö6Ø,¨VÕ4¸ÖDñ  >¸fÀl×SÒSÜ"0Ø")¨&¯+©+¨Ð6_Ð `ó#ð ð Ÿ™ VÖ,ô &ó[ #7r   )r'   r.   r   rž   rß   )rt   Údataclassesr   r   Útypingr   r   Útorch.fxr!   Útorch.fx._compatibilityr   Útorch.fx.graphr   Útorch.fx.passes.utilsr	   r
   Útools_commonr   r   r   Úsplitter_baser   Ú__all__r'   r.   r   r;   rA   rž   rß   rD   r   r   Ú<module>ré      sÕ   ðÛ ß (ß %ã Ý 1Ý "ß Gç LÑ L÷ Ý'ò€ñ  eÔ,ôó -ðñ  eÔ,ôNó -ðNñ  eÔ,Ø
÷+ð +ó ó -ð+ñ0  eÔ,ð  %ØØ16·±×1EÑ1EöJó -ðJñZ  eÔ,ôC-ó -òC-r   