diff --git a/.gitattributes b/.gitattributes index 751f445dc6f2de00d1eabd0deab4047138312a2f..bf248be6ccab89d07b379471a5932e721b3952f1 100644 --- a/.gitattributes +++ b/.gitattributes @@ -69,3 +69,70 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text .inductor_cache/fxgraph/dm/fdm2vzq6owyuyrvgtsaes3bqjsea7j5opkbrjzp5yvk5eaaie5pl/juvux776sz7j5tpilt2sb75ihyp7tky5qivngzbufmm3tjuqpba filter=lfs diff=lfs merge=lfs -text .inductor_cache/fxgraph/do/fdoxsfn5zevmxnouexpdozewmmuesmji2gxbdbzj55iu2kzfirwm/hvjmffewl5g3xzs2qjxlyiinbyyddnb4vdrxjeuae74vp4m2wn6 filter=lfs diff=lfs merge=lfs -text .inductor_cache/fxgraph/e4/fe45sfef754ayge22g3uuqjzhgodjdocya5lpr2tx6l7i4vkqwit/6ry3bcpdcxz45iibyaetr3ddq2vx2x6ubevfyovvrvlttmmlivr filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/e7/fe7rjvsqudc7mdynpxckyzruz5qbwdlzsyoddsghvlawy4qkuwno/uuxeuttgowt73ln3l33wwszimpubfmakop2vbzp6gmwjqftqi3l filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/ei/fei3wm4ykg5woq4h6oytc4gaodljhldyggbzq4eyfi7iq5swlzlw/pz7ruy477v76hacgj2k7a7gyatm6a2p2peasovl4vflx7wrbmps filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/ey/fey32hiuot2ccdtf3a2oyxdzsguhplslw7ydflnyakvptl6hol35/u2l727ulmed6k7wypdeb6f7rxl6azxaczaa7dtti5radgo4ufky filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/ey/feyakc4r4mnth6cqjlpnokxcpvl7km3x5nzqshesc746shvcjvr4/txrjlcygejn3bbk27px5q4cqtgznb65f2oozv2vdqd2egzuvmgt filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/fb/ffbd2tktxo4kzn3tvp2nlusg5c5dr4x7xzggak5yn6ap4o23325q/bixxsp6vchnsdqmqhyigcinlfqbkzon6hg4a6mkufo5w4ebqs2g filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/gl/fgl2ezwpnngo65hibd2xzgub74zln3lcmwy2xuw6dy7yyk7hsode/mm6g26xu6g2bueemf67eqthxfch54nu36shrggpt45k4pnuwaam filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/gp/fgpdq4alamjhslxzl7pd4rw2yake4zfsopzlj3z5t2vulhhbghpx/44hrm7hvryxwfiikexiprsgpvltml32uamrzwxx5qqtdkx3aupw filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/h7/fh7cqiq3m7q5m52ifvohlk7tfcuvajbctngrf4sa6enj6dpox637/hvmazlxdndq3am2vu6w55n7x3nxnkntbuk236yf7lsdjalil2xh filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/hd/fhdaxjf5azxxodtwyvjqnip6v4bljnc7elufyhejve7yslceejpx/ccpknk67vd4wxjy4wruuaaxtkj5vfrnhd24jknec5nu5nhrhym6 filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/hh/fhhhaucvpxvky4yo242on2x7o2f54n7xbysx6em5c5quhp4tejan/cbdzrhspvpkoztyz72ygu4kqh5nfop5kz4sm3njakfjxmeroo5u filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/hl/fhl2gogkhyeubbzuc7boyumbllbgk7reknbvnyvnz3jblhaskm5y/sb5jhkttg47e2q2glr27kckjhcuhyytepus24wp4zbkbpsypdq6 filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/hp/fhp2vtwlnk6hbyy6p26q6s3q2lt5hlh3iydf2uqrmit56fprac57/ebcemnvjxfr6wvpf2hij42iz7tgoqxeb727732swfb6xpdsku3w filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/hx/fhxosbr3fai5ddedj2oaaxzjkdzwk5wfcmwqol3hwmr2pxmv3v2v/tjewjyaqx26zllgyi5nype4t4havm473fh75joieb6im6lzc7ua filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/i6/fi62wulenir4lgd7kj6w5cxibibklyxw2bavotacdzc46h3jlmn3/e7nlh7e3tc3lbnbf76novk3gsgk4ggslzw5qqflg6zlh6jwm5tz filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/j5/fj5bi6el3syiqju2pczjkzdfswidow5kabtrc7dhyz4ykire3rwb/xiu2ry2wsihthoymyxypotcqdwia3fwoh3bbhpf665ryyn2lspb filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/jn/fjnsw4ky4mzqobvh2z2pxyowljbz7zc2giumok5gmwlvahkob5hb/fayhkttwds4yusymqk2s2xzqheuvurmdirn3dxcjueo7vjupae7 filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/jr/fjrrjw3vrndqhyxa2dxc7fageccphtbflxr26it4sm7vq65ok5km/27sdljotq5lcp7jdqnwj4sma2mts7myr4efnnu2brnvjvvhz33v filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/jy/fjyfl4vqvbzn4qz35btve6uyf3dmjuh26hw3b4sygn4pcoa4ucil/lwlflbgvny64rtxsf7rkjgz2xmh5cpovr4yamox3v3aafib3o26 filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/k3/fk3zl5chofpgan3xbyjgbe32s6fs4synzclzdrmtprmvy5ctqxie/nid2r6hqcq7rsymop6jy6w6rk2nrkgl7gbceov5rxp3br6ooxet filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/kh/fkhpsu65antd3avqr7tuvbna3g5s6kvpxw244vu7vqiuokafvonb/l7wgdzkkr4g5icj6igs5vnzjsvtptuhh6dvt5ulefbjos2v3a6e filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/kq/fkqev3z4bqjtr22h2u2hd5klea2ei2lqfneqdlnedqqpbw4i57b5/jfjlcy2zokfpjyjhp4ab3mz6sm6gjnzccee63k555eooeyewkoa filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/kr/fkrr5272r5grajcyqp4popxpibzza5ejd4wrd6e4hnforadubdy6/oxl7g7ienwnhsibyscy3obgaikc5yuftghlhm2w2subjxlbhnz7 filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/kx/fkxyr2wx2tqxrt7kikvs23y4ptbbxhnakyhbixherjyff3yojlb5/bpybplv4xqib7notpujqaxbz5lbuznfgwo3qaa3kjxvnmc5f4xz filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/le/fleixcyyr75qp2r4nisxgmyqp4hn44qrrsagaxhdcdglbsm66x63/n4ovr7bjayn7ywb3gap66aieazywu2kjfatdlb4ohdrseqntd5x filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/lk/flkwsxfghaafg7u2lfuqpw4pgtiztzbux5ukageeqfpv4bc3voxe/p4xwaio7lvojb5m4xrfcar2ksrbyx5byqvdmp23qip5hpmualyb filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/lq/flqpbnciue5y3fyicku6vzqdiiwj6fog7qcct4jxctxngdwswojc/po2y6x4sxovqesm4264kkocxxwfozxnuul4set76bfgyqxupiht filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/m6/fm6bc7mwlgq73nidgpzbkcydpupoj252y5lwq4ysh47s5wbb3ko3/r3gr5jrw224lzaemqsusayvzq2qdxjyexu5434g5sg52xoxxmna filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/nu/fnu5k6yjfvi3opqsws5vro3kwjg27227e55sh4opzkwgzbqhftop/uvnhu6fdcvx2ri2xwcekqs5pbfw57fur3373mgth3ualyrko7s2 filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/ny/fnyvauceymcviuyc2r5e63o622sgjlpq52djfovr6ki4rkfyg4nb/wvp3xjr5juprbwfwipxlf56e7lwvdbw6g6pwapbbhu4x6eiyxhw filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/o6/fo64zkbnneg4ooqirzppxtgeps4367mc6upcoeowlsmbu2yjvg4a/izrc6ultk2ng63fwwlo5j26kpuflnlkksdsiqheflkwy5cpeahj filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/p2/fp2kfduzdbzhu3xok2ofbpgfymkerxlxilzwekqfw3uubncybu3u/dgm4qqvngajpia6egmi6rsi72aybgfr5dkubrgr5ikjcbsby7bu filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/p3/fp3llacea2dubam6rtqx4hay3kgsydthuyrxcxmjeyrxcxgkedpy/nap2rq4xdwcolhcidaxswtnhg3h3xr3hjqfvnolgt3ukptpqwnt filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/p4/fp4n5xphfhx3q3zo4mfu67wxbflh2zgqbo4uj7kx5t4erqvlii6g/vwrhbyhtw76nx4c5t6w3rhh4wrwgvvibecco7tgb77ybwq3ynoh filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/pk/fpkqpesqu73odloyofcpbkgq2ns3teujlqx5wcr4fa7ezyuxgfb6/beuvq4rxkxvfbradlki3eefq6bllbtjhkle4jtbvtblk55qwwpu filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/po/fpon3se375d66r6l5y54vqpdbuacle4vc543u7oph7rua4qgywje/4yzj2wg53aldfs7kp45a4g6snqw73354cx2pv73gfac26woyfnr filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/pu/fpubque3dgfwxmybbsullhiucyag2ikxm5dcwmtmo7u3jpmcsujo/d4tfxhlulkdljmdxb473em34t2jhnsymtv3ns7kxkis6beaareb filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/qo/fqo77da2yaedggk5xbhke5ftqvsmnpjepnoofgt7zjep7h45pumv/5aauysu4gdlzg2tzx6owujzglvdn7dch44vizty2cthwggoig5r filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/qo/fqoaq7cdavpkv2k5eqyso2qrzqdngdrxs5o6q7a4cgdwkderr6vb/tmwqyjsc3mbid725okp7crvo56zftgzkdvngvreuexqae46cnhl filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/r3/fr3u2vqfbkiog5hqn6sln23iqopy7ub4morj3mc7zpbop7rijvpm/rqlnej3h3hbfep2cnaaaiuw73ogufxtowtkzjuhhd3mkytav7k3 filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/r7/fr7dkfnpnjcyrrn7usqi3puetgkc33ccpn4euovnpskmpsdkrx2c/5iqjd2anr2k6w35pblyafvbhm4vfu2g55smsiwxp6fnvqprmnf7 filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/ra/frateegozfvt3wooq6zreuvhfnv3uzmar7wv64duz3sfg5v52ih7/tlmnhxfizxpep4u7okh2rfnv6kkiiuaznri6ga4iduzt5qtrqho filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/rj/frjbz77shgdv4z47o32uocwjqfxyqjkjdmvnd7jcxddd2q2vnhjt/b63yrqq5hkwuj2h6gx42qhqbvks6crqqti6asugnztg2xv6svv3 filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/se/fsedeuzyyl3q4ph2uvw74h55pwh4oy3q556x7eta4d4jbh7qtwde/r2ue2h6mx5h377ewebxcvbc6f3o4pebwbgx7k65rexrbjz7ybfy filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/sf/fsfqondgy3t6rhpczvyslm5cxjc3etsmnodbgrqq6t2mwomnebir/jbjjyikpfafjgszesv5jlkedpzzymr3vsliyayiwzgox7ip5ibr filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/sk/fsklhhrwh5u4oii5v235jzrjfvptbqad6viodk4qwyu5npn74qx4/dgciksgpimhkb2ec75chzt6tsnok2wibnocn5ldjie7nvxfsecg filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/so/fsonsakzuk7pweaiwnpkv6uj7l6elwwieqote53w6l74j36l2zmo/a5ni7qrlputwuct2eglenbfkbzvz63r7i52kobzkos3nz2blvob filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/t4/ft44d5x22evpnk7efpgmm5ccqrsolfslyzmfaoulihyk2x2agvr4/pcnylmxinyio5of2uehwxmxixqx2q2pl4yuvmay3js6rnn2enwq filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/th/fthaaadoumwfiiovuitgm2elhqetoxphtzatbw6cufvedc6p2jn5/tpviisavk5s2cebh2zisha3dr4ozfwtdmucnfyxplfuzhfcwxxk filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/tz/ftzzrngiv5s6k55pjzou4k22p2gyzchqttrsqfopa3plzkft5f2p/mkggurozhisnyt4s5h7qbwow6gwxaqb5feepiqamnh5rkjobmrq filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/ue/fue4jvw7og5afgsiqrs7xvmg5jfuzuql6jdkzlbskztrujfp75u7/yflnzhuydxeu4jvcnbogiyywpwwkzdajooxv537lv77cufac62t filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/uh/fuhj4qnnlxojrbrvsoaahd4du4wxzrwpankr75mjiihmzfvzs4nx/gdof2izhtlfz3sygtwg45h34teiz32pdtesw27w2q5pxpmapjgn filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/uq/fuq7zyvxjpssxrolklivbhvyyfpu7yna2d6oa6u4rtylllamcxbv/vnslr5lpcfetefvwfow6vrrtrpcrdvr7wsgkv2ocg7t2mevyzpy filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/vb/fvbg2yhceiju3psvxasar2r7534uhsajd6aqcmr52fjmph4gjcsu/gtqge7dcfc2rgdw2nt4wexx4owgm6vnqtxvw2k7lhgxkuhe5vu2 filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/vk/fvk4ttkukuswglvaw4ip7pgylylatakntngybzkaj6aemzfze66i/twu4mdnoqfrtusw6vszzcmgezzyw4wtdratwd5wdchdopyuuzrq filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/vr/fvrlcvjtuen5ce3xe4s5xyzx5uhgio5qhvr5vimbsisyzzezyjoi/nzlhk6hbq5qusxfcflozbbih6ugfenexqyygciu46vk3agzoaah filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/w2/fw26sxbkwjeisv22ocikt6okyblb43m7w5l577hrh7xv4pzkf7rz/lgsrmlwgnwnsp6cd6f56gvognp3wrbdxv6jh6t6tzjimx65stlz filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/w3/fw3vwt7ugdqczelrega5shfk6tpyzyqw6zizwfselm2d3rihpgsq/ghouqlm7v3akgutqrlsfcx3yambkes6vy3al43za27rmsj3y67i filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/wt/fwtj4u6pa5amwmeipho73lszaea6ajx5nyyls4fk3duc6rtuz74y/korl4oezyklb3shxaysuepq4dqg2jpwfczct6wqyv2np2ouysqg filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/wt/fwtoi2rc3lztzosc7arolonc6v5y2u6nnqmprgkejo2yfl3xpa6m/c4rwj3eelqkqlmpmwkzca7dkinnkxdkivxti66phwfn4tjcre4u filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/wu/fwu7bnrmso6yhy2arf5wshnytvimb3ndhhvytkurzfdjatdtamuv/ofbwi6kbvxzp5swea6r7eacbfrj2igqxg4ut7ltkt7rxuk6i3il filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/xa/fxacl2dougxatc6gweidew5v7tp5dbyvditoxaxsgfvj7o5oocgg/4ccfvhcub76oeup5stp6muqm6pvtwisoe6h42dtklsuqqgrinnx filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/xs/fxs7q46xfjgwlm2mtpzms3xlqzmg2wgykml4z7xw5vmmrky2izdc/pn3ijnygbkb6qm62n5v6wuxglcn5qptnzv2u477zs2qxd6k6zjn filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/yv/fyvho4fyxbniuj7umghbjfmsrcil4pcrbta7vtya27ebzcvrb556/vr7xaiqnyugmewuayz3rwdapp43vlxdc5oo5ntpmewi4rqfx4di filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/z5/fz5cfzg3d2v4svansdpd3hs7rwl2u6o7p4pdpl3lf2l7ud3ssg5r/hq6pnvrtohnpiryufzsw44gqtvqouqhose3rjazknbi6sy5av6w filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/zd/fzd3rnkf3bwdgpwk6niycf655fa54sjs37tkbuwjnbmhoxpmmgmf/pa3fytonqjrkdncfamlsmbiwwxjzmvhpdoh7fded53dm434l4nx filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/zh/fzhbpnmk5itw3wiswkiq63y4dl5retafqbwopn7nqotc7i33lb4x/g67at2g25bxgtd5hqmzc3ugihuu3tvtwa2j7xpuy4n6uuovxyg6 filter=lfs diff=lfs merge=lfs -text +.inductor_cache/fxgraph/zm/fzm3jejfae77cwvz6m7mphwpa3zn6hojpk73hx3hlihlqkto3kas/w35cec2ogehzh7zizaokclxdcjcfwfgur56zhyfun3ibn2suh2b filter=lfs diff=lfs merge=lfs -text diff --git a/.inductor_cache/fxgraph/e7/fe7rjvsqudc7mdynpxckyzruz5qbwdlzsyoddsghvlawy4qkuwno/uuxeuttgowt73ln3l33wwszimpubfmakop2vbzp6gmwjqftqi3l b/.inductor_cache/fxgraph/e7/fe7rjvsqudc7mdynpxckyzruz5qbwdlzsyoddsghvlawy4qkuwno/uuxeuttgowt73ln3l33wwszimpubfmakop2vbzp6gmwjqftqi3l new file mode 100644 index 0000000000000000000000000000000000000000..7d04a1a6d19c9fd350c2244fd5cc5daba56e9335 --- /dev/null +++ b/.inductor_cache/fxgraph/e7/fe7rjvsqudc7mdynpxckyzruz5qbwdlzsyoddsghvlawy4qkuwno/uuxeuttgowt73ln3l33wwszimpubfmakop2vbzp6gmwjqftqi3l @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a52e4a4e6675a7fdadbb5ef76b4b2863e812b00a73f550e5fe332c98167046d7 +size 276847 diff --git a/.inductor_cache/fxgraph/ei/fei3wm4ykg5woq4h6oytc4gaodljhldyggbzq4eyfi7iq5swlzlw/pz7ruy477v76hacgj2k7a7gyatm6a2p2peasovl4vflx7wrbmps b/.inductor_cache/fxgraph/ei/fei3wm4ykg5woq4h6oytc4gaodljhldyggbzq4eyfi7iq5swlzlw/pz7ruy477v76hacgj2k7a7gyatm6a2p2peasovl4vflx7wrbmps new file mode 100644 index 0000000000000000000000000000000000000000..a52d7caf376ff09f5c88ccce03784680a749f75f --- /dev/null +++ b/.inductor_cache/fxgraph/ei/fei3wm4ykg5woq4h6oytc4gaodljhldyggbzq4eyfi7iq5swlzlw/pz7ruy477v76hacgj2k7a7gyatm6a2p2peasovl4vflx7wrbmps @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7e7f1a639ffd7fe380464e95f07cd804d9e069fa790127557ca9577fda2163e5 +size 256822 diff --git a/.inductor_cache/fxgraph/ey/fey32hiuot2ccdtf3a2oyxdzsguhplslw7ydflnyakvptl6hol35/u2l727ulmed6k7wypdeb6f7rxl6azxaczaa7dtti5radgo4ufky b/.inductor_cache/fxgraph/ey/fey32hiuot2ccdtf3a2oyxdzsguhplslw7ydflnyakvptl6hol35/u2l727ulmed6k7wypdeb6f7rxl6azxaczaa7dtti5radgo4ufky new file mode 100644 index 0000000000000000000000000000000000000000..ccccb43fa673401821606ee2413a86186e70d21c --- /dev/null +++ b/.inductor_cache/fxgraph/ey/fey32hiuot2ccdtf3a2oyxdzsguhplslw7ydflnyakvptl6hol35/u2l727ulmed6k7wypdeb6f7rxl6azxaczaa7dtti5radgo4ufky @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a697fd7e8b6107e57ed878c81f17f1bafc0cdc02c801f1ce68ec40333b942ab1 +size 281966 diff --git a/.inductor_cache/fxgraph/ey/feyakc4r4mnth6cqjlpnokxcpvl7km3x5nzqshesc746shvcjvr4/txrjlcygejn3bbk27px5q4cqtgznb65f2oozv2vdqd2egzuvmgt b/.inductor_cache/fxgraph/ey/feyakc4r4mnth6cqjlpnokxcpvl7km3x5nzqshesc746shvcjvr4/txrjlcygejn3bbk27px5q4cqtgznb65f2oozv2vdqd2egzuvmgt new file mode 100644 index 0000000000000000000000000000000000000000..6ef55e15ae1beaad214c9c00ada7c487427598d5 --- /dev/null +++ b/.inductor_cache/fxgraph/ey/feyakc4r4mnth6cqjlpnokxcpvl7km3x5nzqshesc746shvcjvr4/txrjlcygejn3bbk27px5q4cqtgznb65f2oozv2vdqd2egzuvmgt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9de2958b06225bb0855afbefd8705099b2d0fba5d39d9aeaa380f443669561a7 +size 109104 diff --git a/.inductor_cache/fxgraph/fb/ffbd2tktxo4kzn3tvp2nlusg5c5dr4x7xzggak5yn6ap4o23325q/bixxsp6vchnsdqmqhyigcinlfqbkzon6hg4a6mkufo5w4ebqs2g b/.inductor_cache/fxgraph/fb/ffbd2tktxo4kzn3tvp2nlusg5c5dr4x7xzggak5yn6ap4o23325q/bixxsp6vchnsdqmqhyigcinlfqbkzon6hg4a6mkufo5w4ebqs2g new file mode 100644 index 0000000000000000000000000000000000000000..cd83056c20907f3f229f8ff20efc4867bf42891a --- /dev/null +++ b/.inductor_cache/fxgraph/fb/ffbd2tktxo4kzn3tvp2nlusg5c5dr4x7xzggak5yn6ap4o23325q/bixxsp6vchnsdqmqhyigcinlfqbkzon6hg4a6mkufo5w4ebqs2g @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0a2f793fd511db21c1903e106121ab2c02acb9be39b80f31542bbb6e1030968d +size 109103 diff --git a/.inductor_cache/fxgraph/gl/fgl2ezwpnngo65hibd2xzgub74zln3lcmwy2xuw6dy7yyk7hsode/mm6g26xu6g2bueemf67eqthxfch54nu36shrggpt45k4pnuwaam b/.inductor_cache/fxgraph/gl/fgl2ezwpnngo65hibd2xzgub74zln3lcmwy2xuw6dy7yyk7hsode/mm6g26xu6g2bueemf67eqthxfch54nu36shrggpt45k4pnuwaam new file mode 100644 index 0000000000000000000000000000000000000000..44b675dded471e5f58cec5d7c2babe0028b9f7ca --- /dev/null +++ b/.inductor_cache/fxgraph/gl/fgl2ezwpnngo65hibd2xzgub74zln3lcmwy2xuw6dy7yyk7hsode/mm6g26xu6g2bueemf67eqthxfch54nu36shrggpt45k4pnuwaam @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:633c6d7af4f1b41a108c2fbe484cf7288fde369bf48f1319f3e755c7b6960018 +size 157777 diff --git a/.inductor_cache/fxgraph/gp/fgpdq4alamjhslxzl7pd4rw2yake4zfsopzlj3z5t2vulhhbghpx/44hrm7hvryxwfiikexiprsgpvltml32uamrzwxx5qqtdkx3aupw b/.inductor_cache/fxgraph/gp/fgpdq4alamjhslxzl7pd4rw2yake4zfsopzlj3z5t2vulhhbghpx/44hrm7hvryxwfiikexiprsgpvltml32uamrzwxx5qqtdkx3aupw new file mode 100644 index 0000000000000000000000000000000000000000..9a25f535016beee236d1c264e6f46f04b18eae6c --- /dev/null +++ b/.inductor_cache/fxgraph/gp/fgpdq4alamjhslxzl7pd4rw2yake4zfsopzlj3z5t2vulhhbghpx/44hrm7hvryxwfiikexiprsgpvltml32uamrzwxx5qqtdkx3aupw @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e70f167cf58e2f62a10a25d0f8c8cfaae6c5ef5403239b5efd8426355f60a3ed +size 157777 diff --git a/.inductor_cache/fxgraph/h7/fh7cqiq3m7q5m52ifvohlk7tfcuvajbctngrf4sa6enj6dpox637/hvmazlxdndq3am2vu6w55n7x3nxnkntbuk236yf7lsdjalil2xh b/.inductor_cache/fxgraph/h7/fh7cqiq3m7q5m52ifvohlk7tfcuvajbctngrf4sa6enj6dpox637/hvmazlxdndq3am2vu6w55n7x3nxnkntbuk236yf7lsdjalil2xh new file mode 100644 index 0000000000000000000000000000000000000000..28a63b7442b317c140c03be509ece7d560049c8f --- /dev/null +++ b/.inductor_cache/fxgraph/h7/fh7cqiq3m7q5m52ifvohlk7tfcuvajbctngrf4sa6enj6dpox637/hvmazlxdndq3am2vu6w55n7x3nxnkntbuk236yf7lsdjalil2xh @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3d580caee368e1b03355a7addeb7f7db6ed53661a2b5bf60bf5c86902d0bd5ce +size 157777 diff --git a/.inductor_cache/fxgraph/hd/fhdaxjf5azxxodtwyvjqnip6v4bljnc7elufyhejve7yslceejpx/ccpknk67vd4wxjy4wruuaaxtkj5vfrnhd24jknec5nu5nhrhym6 b/.inductor_cache/fxgraph/hd/fhdaxjf5azxxodtwyvjqnip6v4bljnc7elufyhejve7yslceejpx/ccpknk67vd4wxjy4wruuaaxtkj5vfrnhd24jknec5nu5nhrhym6 new file mode 100644 index 0000000000000000000000000000000000000000..2e9ba0fc75d4a5abdfc1659758656e25d102e6fa --- /dev/null +++ b/.inductor_cache/fxgraph/hd/fhdaxjf5azxxodtwyvjqnip6v4bljnc7elufyhejve7yslceejpx/ccpknk67vd4wxjy4wruuaaxtkj5vfrnhd24jknec5nu5nhrhym6 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:109ea6abdfa8f96ba71cb4694002f3527b52c5a71eb8953482eb69d69e27c33c +size 139369 diff --git a/.inductor_cache/fxgraph/hh/fhhhaucvpxvky4yo242on2x7o2f54n7xbysx6em5c5quhp4tejan/cbdzrhspvpkoztyz72ygu4kqh5nfop5kz4sm3njakfjxmeroo5u b/.inductor_cache/fxgraph/hh/fhhhaucvpxvky4yo242on2x7o2f54n7xbysx6em5c5quhp4tejan/cbdzrhspvpkoztyz72ygu4kqh5nfop5kz4sm3njakfjxmeroo5u new file mode 100644 index 0000000000000000000000000000000000000000..5d3b3b582b4ca67474e37fc89a498f20cd23e90f --- /dev/null +++ b/.inductor_cache/fxgraph/hh/fhhhaucvpxvky4yo242on2x7o2f54n7xbysx6em5c5quhp4tejan/cbdzrhspvpkoztyz72ygu4kqh5nfop5kz4sm3njakfjxmeroo5u @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1047989e4fabd4eccf19feb06a71503f5a573faacf24cdb520515376122e7768 +size 256822 diff --git a/.inductor_cache/fxgraph/hl/fhl2gogkhyeubbzuc7boyumbllbgk7reknbvnyvnz3jblhaskm5y/sb5jhkttg47e2q2glr27kckjhcuhyytepus24wp4zbkbpsypdq6 b/.inductor_cache/fxgraph/hl/fhl2gogkhyeubbzuc7boyumbllbgk7reknbvnyvnz3jblhaskm5y/sb5jhkttg47e2q2glr27kckjhcuhyytepus24wp4zbkbpsypdq6 new file mode 100644 index 0000000000000000000000000000000000000000..686b9091dfe3d9b1bd11c057fc77d1455f8ce082 --- /dev/null +++ b/.inductor_cache/fxgraph/hl/fhl2gogkhyeubbzuc7boyumbllbgk7reknbvnyvnz3jblhaskm5y/sb5jhkttg47e2q2glr27kckjhcuhyytepus24wp4zbkbpsypdq6 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:907a93aa73373e4d43465c75f5094938a87c62647d25ae59fcc85417cb0f1c3c +size 276847 diff --git a/.inductor_cache/fxgraph/hp/fhp2vtwlnk6hbyy6p26q6s3q2lt5hlh3iydf2uqrmit56fprac57/ebcemnvjxfr6wvpf2hij42iz7tgoqxeb727732swfb6xpdsku3w b/.inductor_cache/fxgraph/hp/fhp2vtwlnk6hbyy6p26q6s3q2lt5hlh3iydf2uqrmit56fprac57/ebcemnvjxfr6wvpf2hij42iz7tgoqxeb727732swfb6xpdsku3w new file mode 100644 index 0000000000000000000000000000000000000000..82dc84ea8520a4650562031c10eaed1c23674e2e --- /dev/null +++ b/.inductor_cache/fxgraph/hp/fhp2vtwlnk6hbyy6p26q6s3q2lt5hlh3iydf2uqrmit56fprac57/ebcemnvjxfr6wvpf2hij42iz7tgoqxeb727732swfb6xpdsku3w @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:20444636a9b963eb55e5d1d09e6919fccce85c81febffdea56287d778e4aa6ed +size 179716 diff --git a/.inductor_cache/fxgraph/hx/fhxosbr3fai5ddedj2oaaxzjkdzwk5wfcmwqol3hwmr2pxmv3v2v/tjewjyaqx26zllgyi5nype4t4havm473fh75joieb6im6lzc7ua b/.inductor_cache/fxgraph/hx/fhxosbr3fai5ddedj2oaaxzjkdzwk5wfcmwqol3hwmr2pxmv3v2v/tjewjyaqx26zllgyi5nype4t4havm473fh75joieb6im6lzc7ua new file mode 100644 index 0000000000000000000000000000000000000000..a88c181233495c10190fbc842e61392a55e36bd1 --- /dev/null +++ b/.inductor_cache/fxgraph/hx/fhxosbr3fai5ddedj2oaaxzjkdzwk5wfcmwqol3hwmr2pxmv3v2v/tjewjyaqx26zllgyi5nype4t4havm473fh75joieb6im6lzc7ua @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a4964e010bebd95acd8475b879393e1c15673fb29ffd4b9040f90cf2f22fd00 +size 276847 diff --git a/.inductor_cache/fxgraph/i6/fi62wulenir4lgd7kj6w5cxibibklyxw2bavotacdzc46h3jlmn3/e7nlh7e3tc3lbnbf76novk3gsgk4ggslzw5qqflg6zlh6jwm5tz b/.inductor_cache/fxgraph/i6/fi62wulenir4lgd7kj6w5cxibibklyxw2bavotacdzc46h3jlmn3/e7nlh7e3tc3lbnbf76novk3gsgk4ggslzw5qqflg6zlh6jwm5tz new file mode 100644 index 0000000000000000000000000000000000000000..313070254a8a2d9adba08ab1f942fc80d5f89aa9 --- /dev/null +++ b/.inductor_cache/fxgraph/i6/fi62wulenir4lgd7kj6w5cxibibklyxw2bavotacdzc46h3jlmn3/e7nlh7e3tc3lbnbf76novk3gsgk4ggslzw5qqflg6zlh6jwm5tz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:27dab3fc9b98b6b0b425ff9aeaab669195c31a4bcdbb081566f6567f26ccecf3 +size 159554 diff --git a/.inductor_cache/fxgraph/j5/fj5bi6el3syiqju2pczjkzdfswidow5kabtrc7dhyz4ykire3rwb/xiu2ry2wsihthoymyxypotcqdwia3fwoh3bbhpf665ryyn2lspb b/.inductor_cache/fxgraph/j5/fj5bi6el3syiqju2pczjkzdfswidow5kabtrc7dhyz4ykire3rwb/xiu2ry2wsihthoymyxypotcqdwia3fwoh3bbhpf665ryyn2lspb new file mode 100644 index 0000000000000000000000000000000000000000..de935e7d5bab0e23d719fc024421674eebcf3a71 --- /dev/null +++ b/.inductor_cache/fxgraph/j5/fj5bi6el3syiqju2pczjkzdfswidow5kabtrc7dhyz4ykire3rwb/xiu2ry2wsihthoymyxypotcqdwia3fwoh3bbhpf665ryyn2lspb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ba29a8e356920f33bb0cc5f0f74c501d900d96ce3ec213bcbef7638c374b93c2 +size 147452 diff --git a/.inductor_cache/fxgraph/jn/fjnsw4ky4mzqobvh2z2pxyowljbz7zc2giumok5gmwlvahkob5hb/fayhkttwds4yusymqk2s2xzqheuvurmdirn3dxcjueo7vjupae7 b/.inductor_cache/fxgraph/jn/fjnsw4ky4mzqobvh2z2pxyowljbz7zc2giumok5gmwlvahkob5hb/fayhkttwds4yusymqk2s2xzqheuvurmdirn3dxcjueo7vjupae7 new file mode 100644 index 0000000000000000000000000000000000000000..657917cacb57f68fe1596d20e9d697d37cad9615 --- /dev/null +++ b/.inductor_cache/fxgraph/jn/fjnsw4ky4mzqobvh2z2pxyowljbz7zc2giumok5gmwlvahkob5hb/fayhkttwds4yusymqk2s2xzqheuvurmdirn3dxcjueo7vjupae7 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2830754e761cb98a4b0c82b52d5f3039295a4583445bb1dc49a11dfaa68f013e +size 159586 diff --git a/.inductor_cache/fxgraph/jr/fjrrjw3vrndqhyxa2dxc7fageccphtbflxr26it4sm7vq65ok5km/27sdljotq5lcp7jdqnwj4sma2mts7myr4efnnu2brnvjvvhz33v b/.inductor_cache/fxgraph/jr/fjrrjw3vrndqhyxa2dxc7fageccphtbflxr26it4sm7vq65ok5km/27sdljotq5lcp7jdqnwj4sma2mts7myr4efnnu2brnvjvvhz33v new file mode 100644 index 0000000000000000000000000000000000000000..c89b4a035d2ed532e46aa9082bc92c31d0512b83 --- /dev/null +++ b/.inductor_cache/fxgraph/jr/fjrrjw3vrndqhyxa2dxc7fageccphtbflxr26it4sm7vq65ok5km/27sdljotq5lcp7jdqnwj4sma2mts7myr4efnnu2brnvjvvhz33v @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d7e435a5d3875627fd23836c9e4980d3272fb311e10ad6d3418b6a9ad4f9deeb +size 179716 diff --git a/.inductor_cache/fxgraph/jy/fjyfl4vqvbzn4qz35btve6uyf3dmjuh26hw3b4sygn4pcoa4ucil/lwlflbgvny64rtxsf7rkjgz2xmh5cpovr4yamox3v3aafib3o26 b/.inductor_cache/fxgraph/jy/fjyfl4vqvbzn4qz35btve6uyf3dmjuh26hw3b4sygn4pcoa4ucil/lwlflbgvny64rtxsf7rkjgz2xmh5cpovr4yamox3v3aafib3o26 new file mode 100644 index 0000000000000000000000000000000000000000..7403f7875d5aa15fd0e1d14f3e3d7baba37551d6 --- /dev/null +++ b/.inductor_cache/fxgraph/jy/fjyfl4vqvbzn4qz35btve6uyf3dmjuh26hw3b4sygn4pcoa4ucil/lwlflbgvny64rtxsf7rkjgz2xmh5cpovr4yamox3v3aafib3o26 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5d965584d56e3dc8cef22fe2a49b3abb0fd13dd58f30063afbaec002a03b76bd +size 276847 diff --git a/.inductor_cache/fxgraph/k3/fk3zl5chofpgan3xbyjgbe32s6fs4synzclzdrmtprmvy5ctqxie/nid2r6hqcq7rsymop6jy6w6rk2nrkgl7gbceov5rxp3br6ooxet b/.inductor_cache/fxgraph/k3/fk3zl5chofpgan3xbyjgbe32s6fs4synzclzdrmtprmvy5ctqxie/nid2r6hqcq7rsymop6jy6w6rk2nrkgl7gbceov5rxp3br6ooxet new file mode 100644 index 0000000000000000000000000000000000000000..a762300851243376ac29f8ba8569251bb10a7ba6 --- /dev/null +++ b/.inductor_cache/fxgraph/k3/fk3zl5chofpgan3xbyjgbe32s6fs4synzclzdrmtprmvy5ctqxie/nid2r6hqcq7rsymop6jy6w6rk2nrkgl7gbceov5rxp3br6ooxet @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6a07a8f8f0143f19618e7f938f5bd1569b15197f30444757b1bbf618f9ceb926 +size 179722 diff --git a/.inductor_cache/fxgraph/kh/fkhpsu65antd3avqr7tuvbna3g5s6kvpxw244vu7vqiuokafvonb/l7wgdzkkr4g5icj6igs5vnzjsvtptuhh6dvt5ulefbjos2v3a6e b/.inductor_cache/fxgraph/kh/fkhpsu65antd3avqr7tuvbna3g5s6kvpxw244vu7vqiuokafvonb/l7wgdzkkr4g5icj6igs5vnzjsvtptuhh6dvt5ulefbjos2v3a6e new file mode 100644 index 0000000000000000000000000000000000000000..c4780c11b78e4f1260876c8288d06a77fe2845ce --- /dev/null +++ b/.inductor_cache/fxgraph/kh/fkhpsu65antd3avqr7tuvbna3g5s6kvpxw244vu7vqiuokafvonb/l7wgdzkkr4g5icj6igs5vnzjsvtptuhh6dvt5ulefbjos2v3a6e @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5fec61e54a8f0dd4093e41a5dab7299566f9d0e7f0eb3ed1642852e96abb0789 +size 109104 diff --git a/.inductor_cache/fxgraph/kq/fkqev3z4bqjtr22h2u2hd5klea2ei2lqfneqdlnedqqpbw4i57b5/jfjlcy2zokfpjyjhp4ab3mz6sm6gjnzccee63k555eooeyewkoa b/.inductor_cache/fxgraph/kq/fkqev3z4bqjtr22h2u2hd5klea2ei2lqfneqdlnedqqpbw4i57b5/jfjlcy2zokfpjyjhp4ab3mz6sm6gjnzccee63k555eooeyewkoa new file mode 100644 index 0000000000000000000000000000000000000000..6818a638ba0d4ec07d1c6e5a3346d4650ed3b2ac --- /dev/null +++ b/.inductor_cache/fxgraph/kq/fkqev3z4bqjtr22h2u2hd5klea2ei2lqfneqdlnedqqpbw4i57b5/jfjlcy2zokfpjyjhp4ab3mz6sm6gjnzccee63k555eooeyewkoa @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4952b16359728af4e1277f001db33e933c64b7221109edabbde91ce260965380 +size 159586 diff --git a/.inductor_cache/fxgraph/kr/fkrr5272r5grajcyqp4popxpibzza5ejd4wrd6e4hnforadubdy6/oxl7g7ienwnhsibyscy3obgaikc5yuftghlhm2w2subjxlbhnz7 b/.inductor_cache/fxgraph/kr/fkrr5272r5grajcyqp4popxpibzza5ejd4wrd6e4hnforadubdy6/oxl7g7ienwnhsibyscy3obgaikc5yuftghlhm2w2subjxlbhnz7 new file mode 100644 index 0000000000000000000000000000000000000000..03eac90e3772eb1fd8230af23a817d8b4e846e90 --- /dev/null +++ b/.inductor_cache/fxgraph/kr/fkrr5272r5grajcyqp4popxpibzza5ejd4wrd6e4hnforadubdy6/oxl7g7ienwnhsibyscy3obgaikc5yuftghlhm2w2subjxlbhnz7 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:75d7f37d046d9a79203890b1b704c04285dc50b331d6766ada95029bac276e7f +size 256822 diff --git a/.inductor_cache/fxgraph/kx/fkxyr2wx2tqxrt7kikvs23y4ptbbxhnakyhbixherjyff3yojlb5/bpybplv4xqib7notpujqaxbz5lbuznfgwo3qaa3kjxvnmc5f4xz b/.inductor_cache/fxgraph/kx/fkxyr2wx2tqxrt7kikvs23y4ptbbxhnakyhbixherjyff3yojlb5/bpybplv4xqib7notpujqaxbz5lbuznfgwo3qaa3kjxvnmc5f4xz new file mode 100644 index 0000000000000000000000000000000000000000..a5a81aac26ff77b0d3cb636121f8e29861c0ab0f --- /dev/null +++ b/.inductor_cache/fxgraph/kx/fkxyr2wx2tqxrt7kikvs23y4ptbbxhnakyhbixherjyff3yojlb5/bpybplv4xqib7notpujqaxbz5lbuznfgwo3qaa3kjxvnmc5f4xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0bf017aebcbc101fb5d37d13005c39eac34cb4a6b3b700036a4dead60ba5e5f2 +size 281966 diff --git a/.inductor_cache/fxgraph/le/fleixcyyr75qp2r4nisxgmyqp4hn44qrrsagaxhdcdglbsm66x63/n4ovr7bjayn7ywb3gap66aieazywu2kjfatdlb4ohdrseqntd5x b/.inductor_cache/fxgraph/le/fleixcyyr75qp2r4nisxgmyqp4hn44qrrsagaxhdcdglbsm66x63/n4ovr7bjayn7ywb3gap66aieazywu2kjfatdlb4ohdrseqntd5x new file mode 100644 index 0000000000000000000000000000000000000000..93cd7543a734731a61f78f687ff6de52406432ed --- /dev/null +++ b/.inductor_cache/fxgraph/le/fleixcyyr75qp2r4nisxgmyqp4hn44qrrsagaxhdcdglbsm66x63/n4ovr7bjayn7ywb3gap66aieazywu2kjfatdlb4ohdrseqntd5x @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6f1d58fc29061bfc583b301fef010406716a6949282635878e38e32241b31f6e +size 276847 diff --git a/.inductor_cache/fxgraph/lk/flkwsxfghaafg7u2lfuqpw4pgtiztzbux5ukageeqfpv4bc3voxe/p4xwaio7lvojb5m4xrfcar2ksrbyx5byqvdmp23qip5hpmualyb b/.inductor_cache/fxgraph/lk/flkwsxfghaafg7u2lfuqpw4pgtiztzbux5ukageeqfpv4bc3voxe/p4xwaio7lvojb5m4xrfcar2ksrbyx5byqvdmp23qip5hpmualyb new file mode 100644 index 0000000000000000000000000000000000000000..95035e8a01fcf6ba01aa9dfe218a5a8dc587d9b5 --- /dev/null +++ b/.inductor_cache/fxgraph/lk/flkwsxfghaafg7u2lfuqpw4pgtiztzbux5ukageeqfpv4bc3voxe/p4xwaio7lvojb5m4xrfcar2ksrbyx5byqvdmp23qip5hpmualyb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7f2f6021df5d5c90f59cbc4a20474a94438bf4388546c7eb7043fa77b2805e03 +size 118484 diff --git a/.inductor_cache/fxgraph/lq/flqpbnciue5y3fyicku6vzqdiiwj6fog7qcct4jxctxngdwswojc/po2y6x4sxovqesm4264kkocxxwfozxnuul4set76bfgyqxupiht b/.inductor_cache/fxgraph/lq/flqpbnciue5y3fyicku6vzqdiiwj6fog7qcct4jxctxngdwswojc/po2y6x4sxovqesm4264kkocxxwfozxnuul4set76bfgyqxupiht new file mode 100644 index 0000000000000000000000000000000000000000..ed3129ef1585f57d8b36c755e2923f3b9f2cf141 --- /dev/null +++ b/.inductor_cache/fxgraph/lq/flqpbnciue5y3fyicku6vzqdiiwj6fog7qcct4jxctxngdwswojc/po2y6x4sxovqesm4264kkocxxwfozxnuul4set76bfgyqxupiht @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7bb58f5f92bbab02499cd7b8a53857bd8aecddb4a2f9224ffe094d885e8f41e7 +size 157777 diff --git a/.inductor_cache/fxgraph/m6/fm6bc7mwlgq73nidgpzbkcydpupoj252y5lwq4ysh47s5wbb3ko3/r3gr5jrw224lzaemqsusayvzq2qdxjyexu5434g5sg52xoxxmna b/.inductor_cache/fxgraph/m6/fm6bc7mwlgq73nidgpzbkcydpupoj252y5lwq4ysh47s5wbb3ko3/r3gr5jrw224lzaemqsusayvzq2qdxjyexu5434g5sg52xoxxmna new file mode 100644 index 0000000000000000000000000000000000000000..9fb73c72926b7fae8711eae2236a5a5ea9b8da98 --- /dev/null +++ b/.inductor_cache/fxgraph/m6/fm6bc7mwlgq73nidgpzbkcydpupoj252y5lwq4ysh47s5wbb3ko3/r3gr5jrw224lzaemqsusayvzq2qdxjyexu5434g5sg52xoxxmna @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8ecd1ea636d6b8bc808c84a92062b986a03ba704bd3bcdf0dd91bbabbaf76341 +size 276847 diff --git a/.inductor_cache/fxgraph/nu/fnu5k6yjfvi3opqsws5vro3kwjg27227e55sh4opzkwgzbqhftop/uvnhu6fdcvx2ri2xwcekqs5pbfw57fur3373mgth3ualyrko7s2 b/.inductor_cache/fxgraph/nu/fnu5k6yjfvi3opqsws5vro3kwjg27227e55sh4opzkwgzbqhftop/uvnhu6fdcvx2ri2xwcekqs5pbfw57fur3373mgth3ualyrko7s2 new file mode 100644 index 0000000000000000000000000000000000000000..82e60c39b70f4c5bb9d22a0bdcb8db98f1dea02a --- /dev/null +++ b/.inductor_cache/fxgraph/nu/fnu5k6yjfvi3opqsws5vro3kwjg27227e55sh4opzkwgzbqhftop/uvnhu6fdcvx2ri2xwcekqs5pbfw57fur3373mgth3ualyrko7s2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a55a7a78a3156fa8a357b088a84baf096ddf9691deffb61a67dd00bc454efcb4 +size 159586 diff --git a/.inductor_cache/fxgraph/ny/fnyvauceymcviuyc2r5e63o622sgjlpq52djfovr6ki4rkfyg4nb/wvp3xjr5juprbwfwipxlf56e7lwvdbw6g6pwapbbhu4x6eiyxhw b/.inductor_cache/fxgraph/ny/fnyvauceymcviuyc2r5e63o622sgjlpq52djfovr6ki4rkfyg4nb/wvp3xjr5juprbwfwipxlf56e7lwvdbw6g6pwapbbhu4x6eiyxhw new file mode 100644 index 0000000000000000000000000000000000000000..b4dc2fde365b04f008b4c0031b3e59648b154179 --- /dev/null +++ b/.inductor_cache/fxgraph/ny/fnyvauceymcviuyc2r5e63o622sgjlpq52djfovr6ki4rkfyg4nb/wvp3xjr5juprbwfwipxlf56e7lwvdbw6g6pwapbbhu4x6eiyxhw @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b55fbba63d4d1f10d8b643eeb2f7c4faed5186de379f603c213d397f1118b9ed +size 159554 diff --git a/.inductor_cache/fxgraph/o6/fo64zkbnneg4ooqirzppxtgeps4367mc6upcoeowlsmbu2yjvg4a/izrc6ultk2ng63fwwlo5j26kpuflnlkksdsiqheflkwy5cpeahj b/.inductor_cache/fxgraph/o6/fo64zkbnneg4ooqirzppxtgeps4367mc6upcoeowlsmbu2yjvg4a/izrc6ultk2ng63fwwlo5j26kpuflnlkksdsiqheflkwy5cpeahj new file mode 100644 index 0000000000000000000000000000000000000000..968d799fb4fcfad7cc83eb3e798e1bf989963803 --- /dev/null +++ b/.inductor_cache/fxgraph/o6/fo64zkbnneg4ooqirzppxtgeps4367mc6upcoeowlsmbu2yjvg4a/izrc6ultk2ng63fwwlo5j26kpuflnlkksdsiqheflkwy5cpeahj @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:46622f5173569a6f6cb6b2ddd4ebca7d0ab6ad4a90e4881c855aad8e89e401d2 +size 139369 diff --git a/.inductor_cache/fxgraph/p2/fp2kfduzdbzhu3xok2ofbpgfymkerxlxilzwekqfw3uubncybu3u/dgm4qqvngajpia6egmi6rsi72aybgfr5dkubrgr5ikjcbsby7bu b/.inductor_cache/fxgraph/p2/fp2kfduzdbzhu3xok2ofbpgfymkerxlxilzwekqfw3uubncybu3u/dgm4qqvngajpia6egmi6rsi72aybgfr5dkubrgr5ikjcbsby7bu new file mode 100644 index 0000000000000000000000000000000000000000..418a85a39f2499227181481715849baa19edaf85 --- /dev/null +++ b/.inductor_cache/fxgraph/p2/fp2kfduzdbzhu3xok2ofbpgfymkerxlxilzwekqfw3uubncybu3u/dgm4qqvngajpia6egmi6rsi72aybgfr5dkubrgr5ikjcbsby7bu @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1999c842ad3012f403c43311e8c91fd03013163d1aa8189a3d429220c838f869 +size 139369 diff --git a/.inductor_cache/fxgraph/p3/fp3llacea2dubam6rtqx4hay3kgsydthuyrxcxmjeyrxcxgkedpy/nap2rq4xdwcolhcidaxswtnhg3h3xr3hjqfvnolgt3ukptpqwnt b/.inductor_cache/fxgraph/p3/fp3llacea2dubam6rtqx4hay3kgsydthuyrxcxmjeyrxcxgkedpy/nap2rq4xdwcolhcidaxswtnhg3h3xr3hjqfvnolgt3ukptpqwnt new file mode 100644 index 0000000000000000000000000000000000000000..8306696b1cc642b6e973f628bdf858ca16bc6c34 --- /dev/null +++ b/.inductor_cache/fxgraph/p3/fp3llacea2dubam6rtqx4hay3kgsydthuyrxcxmjeyrxcxgkedpy/nap2rq4xdwcolhcidaxswtnhg3h3xr3hjqfvnolgt3ukptpqwnt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:681fa8c3971d84e59c48182f2b4da736cfbbc7674c0b56b9669ee8a7cdf0b366 +size 118484 diff --git a/.inductor_cache/fxgraph/p4/fp4n5xphfhx3q3zo4mfu67wxbflh2zgqbo4uj7kx5t4erqvlii6g/vwrhbyhtw76nx4c5t6w3rhh4wrwgvvibecco7tgb77ybwq3ynoh b/.inductor_cache/fxgraph/p4/fp4n5xphfhx3q3zo4mfu67wxbflh2zgqbo4uj7kx5t4erqvlii6g/vwrhbyhtw76nx4c5t6w3rhh4wrwgvvibecco7tgb77ybwq3ynoh new file mode 100644 index 0000000000000000000000000000000000000000..a0a6d139a021bb2a886f25b6b92ab7eb73faf548 --- /dev/null +++ b/.inductor_cache/fxgraph/p4/fp4n5xphfhx3q3zo4mfu67wxbflh2zgqbo4uj7kx5t4erqvlii6g/vwrhbyhtw76nx4c5t6w3rhh4wrwgvvibecco7tgb77ybwq3ynoh @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ada270e0f3b7fcdbf05d9fadb89cfcb46c6ad5012084efccc1fff01b43786b8e +size 159586 diff --git a/.inductor_cache/fxgraph/pk/fpkqpesqu73odloyofcpbkgq2ns3teujlqx5wcr4fa7ezyuxgfb6/beuvq4rxkxvfbradlki3eefq6bllbtjhkle4jtbvtblk55qwwpu b/.inductor_cache/fxgraph/pk/fpkqpesqu73odloyofcpbkgq2ns3teujlqx5wcr4fa7ezyuxgfb6/beuvq4rxkxvfbradlki3eefq6bllbtjhkle4jtbvtblk55qwwpu new file mode 100644 index 0000000000000000000000000000000000000000..6b7be6198fccbff08d7f4ac62755f9685df84e22 --- /dev/null +++ b/.inductor_cache/fxgraph/pk/fpkqpesqu73odloyofcpbkgq2ns3teujlqx5wcr4fa7ezyuxgfb6/beuvq4rxkxvfbradlki3eefq6bllbtjhkle4jtbvtblk55qwwpu @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:092958723755ea50c4035a91b210b0f056b0cd2752c9c4cc359856aef616b3e9 +size 157777 diff --git a/.inductor_cache/fxgraph/po/fpon3se375d66r6l5y54vqpdbuacle4vc543u7oph7rua4qgywje/4yzj2wg53aldfs7kp45a4g6snqw73354cx2pv73gfac26woyfnr b/.inductor_cache/fxgraph/po/fpon3se375d66r6l5y54vqpdbuacle4vc543u7oph7rua4qgywje/4yzj2wg53aldfs7kp45a4g6snqw73354cx2pv73gfac26woyfnr new file mode 100644 index 0000000000000000000000000000000000000000..2e095cd123e4c83376a9146be2badc6111436e23 --- /dev/null +++ b/.inductor_cache/fxgraph/po/fpon3se375d66r6l5y54vqpdbuacle4vc543u7oph7rua4qgywje/4yzj2wg53aldfs7kp45a4g6snqw73354cx2pv73gfac26woyfnr @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e6329d58ddd81632cbea7f3a0e1bd26c2dfdefbc15f4faff662805af59d82b63 +size 159586 diff --git a/.inductor_cache/fxgraph/pu/fpubque3dgfwxmybbsullhiucyag2ikxm5dcwmtmo7u3jpmcsujo/d4tfxhlulkdljmdxb473em34t2jhnsymtv3ns7kxkis6beaareb b/.inductor_cache/fxgraph/pu/fpubque3dgfwxmybbsullhiucyag2ikxm5dcwmtmo7u3jpmcsujo/d4tfxhlulkdljmdxb473em34t2jhnsymtv3ns7kxkis6beaareb new file mode 100644 index 0000000000000000000000000000000000000000..f2d3573870e1e0783c5d0f5d4c2fdca9f0a0c740 --- /dev/null +++ b/.inductor_cache/fxgraph/pu/fpubque3dgfwxmybbsullhiucyag2ikxm5dcwmtmo7u3jpmcsujo/d4tfxhlulkdljmdxb473em34t2jhnsymtv3ns7kxkis6beaareb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1f265b9d745a86b4b0770f3fb2337c9e9276cb0c9d76d97d575225e090008902 +size 281966 diff --git a/.inductor_cache/fxgraph/qo/fqo77da2yaedggk5xbhke5ftqvsmnpjepnoofgt7zjep7h45pumv/5aauysu4gdlzg2tzx6owujzglvdn7dch44vizty2cthwggoig5r b/.inductor_cache/fxgraph/qo/fqo77da2yaedggk5xbhke5ftqvsmnpjepnoofgt7zjep7h45pumv/5aauysu4gdlzg2tzx6owujzglvdn7dch44vizty2cthwggoig5r new file mode 100644 index 0000000000000000000000000000000000000000..34307b2f1f0475fff233927995c9f6467d9023b6 --- /dev/null +++ b/.inductor_cache/fxgraph/qo/fqo77da2yaedggk5xbhke5ftqvsmnpjepnoofgt7zjep7h45pumv/5aauysu4gdlzg2tzx6owujzglvdn7dch44vizty2cthwggoig5r @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e8014c4a9c30d7936a79bf9d6a27265d46df8c47e72a8ccf1a14cf6319c83762 +size 281966 diff --git a/.inductor_cache/fxgraph/qo/fqoaq7cdavpkv2k5eqyso2qrzqdngdrxs5o6q7a4cgdwkderr6vb/tmwqyjsc3mbid725okp7crvo56zftgzkdvngvreuexqae46cnhl b/.inductor_cache/fxgraph/qo/fqoaq7cdavpkv2k5eqyso2qrzqdngdrxs5o6q7a4cgdwkderr6vb/tmwqyjsc3mbid725okp7crvo56zftgzkdvngvreuexqae46cnhl new file mode 100644 index 0000000000000000000000000000000000000000..88b8d600dc1e8bcfff5a89dd41805245dae96f52 --- /dev/null +++ b/.inductor_cache/fxgraph/qo/fqoaq7cdavpkv2k5eqyso2qrzqdngdrxs5o6q7a4cgdwkderr6vb/tmwqyjsc3mbid725okp7crvo56zftgzkdvngvreuexqae46cnhl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9b2d0c2642db0281ff5d729ff146aeefb2599b2a1d5a6ac49425e00273c269d7 +size 281515 diff --git a/.inductor_cache/fxgraph/r3/fr3u2vqfbkiog5hqn6sln23iqopy7ub4morj3mc7zpbop7rijvpm/rqlnej3h3hbfep2cnaaaiuw73ogufxtowtkzjuhhd3mkytav7k3 b/.inductor_cache/fxgraph/r3/fr3u2vqfbkiog5hqn6sln23iqopy7ub4morj3mc7zpbop7rijvpm/rqlnej3h3hbfep2cnaaaiuw73ogufxtowtkzjuhhd3mkytav7k3 new file mode 100644 index 0000000000000000000000000000000000000000..556077b50aaf985fa3740c76c3fa36c7caefe3c3 --- /dev/null +++ b/.inductor_cache/fxgraph/r3/fr3u2vqfbkiog5hqn6sln23iqopy7ub4morj3mc7zpbop7rijvpm/rqlnej3h3hbfep2cnaaaiuw73ogufxtowtkzjuhhd3mkytav7k3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8c16d22767d9c2523f4268000452dfdb8d42de6eb4d594d0e71ed8ac4c15fab6 +size 157777 diff --git a/.inductor_cache/fxgraph/r7/fr7dkfnpnjcyrrn7usqi3puetgkc33ccpn4euovnpskmpsdkrx2c/5iqjd2anr2k6w35pblyafvbhm4vfu2g55smsiwxp6fnvqprmnf7 b/.inductor_cache/fxgraph/r7/fr7dkfnpnjcyrrn7usqi3puetgkc33ccpn4euovnpskmpsdkrx2c/5iqjd2anr2k6w35pblyafvbhm4vfu2g55smsiwxp6fnvqprmnf7 new file mode 100644 index 0000000000000000000000000000000000000000..c49f3cf7e3bf113d81b81174580de6cc8ad18fdc --- /dev/null +++ b/.inductor_cache/fxgraph/r7/fr7dkfnpnjcyrrn7usqi3puetgkc33ccpn4euovnpskmpsdkrx2c/5iqjd2anr2k6w35pblyafvbhm4vfu2g55smsiwxp6fnvqprmnf7 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ea2091e80d8e95eb6faf0af002d427672a5a68ddec99245aeff15b583e2c697e +size 179716 diff --git a/.inductor_cache/fxgraph/ra/frateegozfvt3wooq6zreuvhfnv3uzmar7wv64duz3sfg5v52ih7/tlmnhxfizxpep4u7okh2rfnv6kkiiuaznri6ga4iduzt5qtrqho b/.inductor_cache/fxgraph/ra/frateegozfvt3wooq6zreuvhfnv3uzmar7wv64duz3sfg5v52ih7/tlmnhxfizxpep4u7okh2rfnv6kkiiuaznri6ga4iduzt5qtrqho new file mode 100644 index 0000000000000000000000000000000000000000..e0c37ef2dd84b08adb0cbf5f5bb6653d180b916f --- /dev/null +++ b/.inductor_cache/fxgraph/ra/frateegozfvt3wooq6zreuvhfnv3uzmar7wv64duz3sfg5v52ih7/tlmnhxfizxpep4u7okh2rfnv6kkiiuaznri6ga4iduzt5qtrqho @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9ad8d3dca8cdde47f29f728fa895b5f2948450196c51e303881d333ec27181dd +size 281515 diff --git a/.inductor_cache/fxgraph/rj/frjbz77shgdv4z47o32uocwjqfxyqjkjdmvnd7jcxddd2q2vnhjt/b63yrqq5hkwuj2h6gx42qhqbvks6crqqti6asugnztg2xv6svv3 b/.inductor_cache/fxgraph/rj/frjbz77shgdv4z47o32uocwjqfxyqjkjdmvnd7jcxddd2q2vnhjt/b63yrqq5hkwuj2h6gx42qhqbvks6crqqti6asugnztg2xv6svv3 new file mode 100644 index 0000000000000000000000000000000000000000..c480729fd0d738ae124c4720d980c27f3c2de27f --- /dev/null +++ b/.inductor_cache/fxgraph/rj/frjbz77shgdv4z47o32uocwjqfxyqjkjdmvnd7jcxddd2q2vnhjt/b63yrqq5hkwuj2h6gx42qhqbvks6crqqti6asugnztg2xv6svv3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0fb788c21d3aad44e8fe35f9a81e01aaa5e146109a3c0950cdcccdabd7d2ad76 +size 281966 diff --git a/.inductor_cache/fxgraph/se/fsedeuzyyl3q4ph2uvw74h55pwh4oy3q556x7eta4d4jbh7qtwde/r2ue2h6mx5h377ewebxcvbc6f3o4pebwbgx7k65rexrbjz7ybfy b/.inductor_cache/fxgraph/se/fsedeuzyyl3q4ph2uvw74h55pwh4oy3q556x7eta4d4jbh7qtwde/r2ue2h6mx5h377ewebxcvbc6f3o4pebwbgx7k65rexrbjz7ybfy new file mode 100644 index 0000000000000000000000000000000000000000..17ecd9c6a2fd90c5aea50b9e74f90b8b6d0b9ce6 --- /dev/null +++ b/.inductor_cache/fxgraph/se/fsedeuzyyl3q4ph2uvw74h55pwh4oy3q556x7eta4d4jbh7qtwde/r2ue2h6mx5h377ewebxcvbc6f3o4pebwbgx7k65rexrbjz7ybfy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8ea84d1fccbf4fbffc96206e2a845e2eddc7903609aff57bb125e214e7f80970 +size 159586 diff --git a/.inductor_cache/fxgraph/sf/fsfqondgy3t6rhpczvyslm5cxjc3etsmnodbgrqq6t2mwomnebir/jbjjyikpfafjgszesv5jlkedpzzymr3vsliyayiwzgox7ip5ibr b/.inductor_cache/fxgraph/sf/fsfqondgy3t6rhpczvyslm5cxjc3etsmnodbgrqq6t2mwomnebir/jbjjyikpfafjgszesv5jlkedpzzymr3vsliyayiwzgox7ip5ibr new file mode 100644 index 0000000000000000000000000000000000000000..8d570aa40fceb9ba8605cdeea0dbc09ab8d4c7ad --- /dev/null +++ b/.inductor_cache/fxgraph/sf/fsfqondgy3t6rhpczvyslm5cxjc3etsmnodbgrqq6t2mwomnebir/jbjjyikpfafjgszesv5jlkedpzzymr3vsliyayiwzgox7ip5ibr @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:48529c214f280a934b24957a95a8837e7386477592d1806116c99d7fa1fd4062 +size 118484 diff --git a/.inductor_cache/fxgraph/sk/fsklhhrwh5u4oii5v235jzrjfvptbqad6viodk4qwyu5npn74qx4/dgciksgpimhkb2ec75chzt6tsnok2wibnocn5ldjie7nvxfsecg b/.inductor_cache/fxgraph/sk/fsklhhrwh5u4oii5v235jzrjfvptbqad6viodk4qwyu5npn74qx4/dgciksgpimhkb2ec75chzt6tsnok2wibnocn5ldjie7nvxfsecg new file mode 100644 index 0000000000000000000000000000000000000000..0ce4dc8028b1f3c8f2f449bd5b10c6e565c216bd --- /dev/null +++ b/.inductor_cache/fxgraph/sk/fsklhhrwh5u4oii5v235jzrjfvptbqad6viodk4qwyu5npn74qx4/dgciksgpimhkb2ec75chzt6tsnok2wibnocn5ldjie7nvxfsecg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:19848548cf430ea0e882ff447ccfd3935cad59016b84deac69413edadcb2208c +size 147452 diff --git a/.inductor_cache/fxgraph/so/fsonsakzuk7pweaiwnpkv6uj7l6elwwieqote53w6l74j36l2zmo/a5ni7qrlputwuct2eglenbfkbzvz63r7i52kobzkos3nz2blvob b/.inductor_cache/fxgraph/so/fsonsakzuk7pweaiwnpkv6uj7l6elwwieqote53w6l74j36l2zmo/a5ni7qrlputwuct2eglenbfkbzvz63r7i52kobzkos3nz2blvob new file mode 100644 index 0000000000000000000000000000000000000000..7e8f1dfe89fe9a68b7c6b1564c028d0c486e1610 --- /dev/null +++ b/.inductor_cache/fxgraph/so/fsonsakzuk7pweaiwnpkv6uj7l6elwwieqote53w6l74j36l2zmo/a5ni7qrlputwuct2eglenbfkbzvz63r7i52kobzkos3nz2blvob @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:075a8fc22b7d276a0a7a21964684aa0e6b9f6e3f4774a7072a74b6dce82bab83 +size 281966 diff --git a/.inductor_cache/fxgraph/t4/ft44d5x22evpnk7efpgmm5ccqrsolfslyzmfaoulihyk2x2agvr4/pcnylmxinyio5of2uehwxmxixqx2q2pl4yuvmay3js6rnn2enwq b/.inductor_cache/fxgraph/t4/ft44d5x22evpnk7efpgmm5ccqrsolfslyzmfaoulihyk2x2agvr4/pcnylmxinyio5of2uehwxmxixqx2q2pl4yuvmay3js6rnn2enwq new file mode 100644 index 0000000000000000000000000000000000000000..285845112cd911d026bc64bad6610b75b6ca7277 --- /dev/null +++ b/.inductor_cache/fxgraph/t4/ft44d5x22evpnk7efpgmm5ccqrsolfslyzmfaoulihyk2x2agvr4/pcnylmxinyio5of2uehwxmxixqx2q2pl4yuvmay3js6rnn2enwq @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:789b85b2e86e10eeb8baa10f6bb2e8bc2fa869ebe62956031b4cbd16b7446da0 +size 139369 diff --git a/.inductor_cache/fxgraph/th/fthaaadoumwfiiovuitgm2elhqetoxphtzatbw6cufvedc6p2jn5/tpviisavk5s2cebh2zisha3dr4ozfwtdmucnfyxplfuzhfcwxxk b/.inductor_cache/fxgraph/th/fthaaadoumwfiiovuitgm2elhqetoxphtzatbw6cufvedc6p2jn5/tpviisavk5s2cebh2zisha3dr4ozfwtdmucnfyxplfuzhfcwxxk new file mode 100644 index 0000000000000000000000000000000000000000..2c97d6ea8f4e491f14f9ff992c69a0a76471f180 --- /dev/null +++ b/.inductor_cache/fxgraph/th/fthaaadoumwfiiovuitgm2elhqetoxphtzatbw6cufvedc6p2jn5/tpviisavk5s2cebh2zisha3dr4ozfwtdmucnfyxplfuzhfcwxxk @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9bea8448155765a11027d6512383638f1d92da636504d2e2ef5969939456bdd5 +size 159554 diff --git a/.inductor_cache/fxgraph/tz/ftzzrngiv5s6k55pjzou4k22p2gyzchqttrsqfopa3plzkft5f2p/mkggurozhisnyt4s5h7qbwow6gwxaqb5feepiqamnh5rkjobmrq b/.inductor_cache/fxgraph/tz/ftzzrngiv5s6k55pjzou4k22p2gyzchqttrsqfopa3plzkft5f2p/mkggurozhisnyt4s5h7qbwow6gwxaqb5feepiqamnh5rkjobmrq new file mode 100644 index 0000000000000000000000000000000000000000..76b9f08bae2ae796245b60e699dc64f5ba62c0d9 --- /dev/null +++ b/.inductor_cache/fxgraph/tz/ftzzrngiv5s6k55pjzou4k22p2gyzchqttrsqfopa3plzkft5f2p/mkggurozhisnyt4s5h7qbwow6gwxaqb5feepiqamnh5rkjobmrq @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:628c6a45d93a24dc4f92e9ff00d9d6f1ad70403d2908f4400c69fb1525c16460 +size 139369 diff --git a/.inductor_cache/fxgraph/ue/fue4jvw7og5afgsiqrs7xvmg5jfuzuql6jdkzlbskztrujfp75u7/yflnzhuydxeu4jvcnbogiyywpwwkzdajooxv537lv77cufac62t b/.inductor_cache/fxgraph/ue/fue4jvw7og5afgsiqrs7xvmg5jfuzuql6jdkzlbskztrujfp75u7/yflnzhuydxeu4jvcnbogiyywpwwkzdajooxv537lv77cufac62t new file mode 100644 index 0000000000000000000000000000000000000000..c88d3b84141f06e63b36d31789980ae9bd91cf16 --- /dev/null +++ b/.inductor_cache/fxgraph/ue/fue4jvw7og5afgsiqrs7xvmg5jfuzuql6jdkzlbskztrujfp75u7/yflnzhuydxeu4jvcnbogiyywpwwkzdajooxv537lv77cufac62t @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c156dc9e981dc94e26a2685c6463167dacac8c0973af5eefebaffe2a1402f6a6 +size 281515 diff --git a/.inductor_cache/fxgraph/uh/fuhj4qnnlxojrbrvsoaahd4du4wxzrwpankr75mjiihmzfvzs4nx/gdof2izhtlfz3sygtwg45h34teiz32pdtesw27w2q5pxpmapjgn b/.inductor_cache/fxgraph/uh/fuhj4qnnlxojrbrvsoaahd4du4wxzrwpankr75mjiihmzfvzs4nx/gdof2izhtlfz3sygtwg45h34teiz32pdtesw27w2q5pxpmapjgn new file mode 100644 index 0000000000000000000000000000000000000000..860bcd76194ec239e9c06be51d65a7c51d2db7e3 --- /dev/null +++ b/.inductor_cache/fxgraph/uh/fuhj4qnnlxojrbrvsoaahd4du4wxzrwpankr75mjiihmzfvzs4nx/gdof2izhtlfz3sygtwg45h34teiz32pdtesw27w2q5pxpmapjgn @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:30dc5d23279acb9dcb069d8dce9f7c99119de9e399256d7eda875f77b00f499a +size 281966 diff --git a/.inductor_cache/fxgraph/uq/fuq7zyvxjpssxrolklivbhvyyfpu7yna2d6oa6u4rtylllamcxbv/vnslr5lpcfetefvwfow6vrrtrpcrdvr7wsgkv2ocg7t2mevyzpy b/.inductor_cache/fxgraph/uq/fuq7zyvxjpssxrolklivbhvyyfpu7yna2d6oa6u4rtylllamcxbv/vnslr5lpcfetefvwfow6vrrtrpcrdvr7wsgkv2ocg7t2mevyzpy new file mode 100644 index 0000000000000000000000000000000000000000..b01db94c733c68730e36d57997aa9ae93caa0969 --- /dev/null +++ b/.inductor_cache/fxgraph/uq/fuq7zyvxjpssxrolklivbhvyyfpu7yna2d6oa6u4rtylllamcxbv/vnslr5lpcfetefvwfow6vrrtrpcrdvr7wsgkv2ocg7t2mevyzpy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ab64b8f56f11493216b62badeac6338bc511d63fb48caae9c237e7a612b8cbf1 +size 147440 diff --git a/.inductor_cache/fxgraph/vb/fvbg2yhceiju3psvxasar2r7534uhsajd6aqcmr52fjmph4gjcsu/gtqge7dcfc2rgdw2nt4wexx4owgm6vnqtxvw2k7lhgxkuhe5vu2 b/.inductor_cache/fxgraph/vb/fvbg2yhceiju3psvxasar2r7534uhsajd6aqcmr52fjmph4gjcsu/gtqge7dcfc2rgdw2nt4wexx4owgm6vnqtxvw2k7lhgxkuhe5vu2 new file mode 100644 index 0000000000000000000000000000000000000000..89170a27c380c985ce0b8be41b85794515d9dffa --- /dev/null +++ b/.inductor_cache/fxgraph/vb/fvbg2yhceiju3psvxasar2r7534uhsajd6aqcmr52fjmph4gjcsu/gtqge7dcfc2rgdw2nt4wexx4owgm6vnqtxvw2k7lhgxkuhe5vu2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:34e0627c6228b5130eda6cf9625efc758ccf55b09deb6d2beb39aeaa1c9dad34 +size 159586 diff --git a/.inductor_cache/fxgraph/vk/fvk4ttkukuswglvaw4ip7pgylylatakntngybzkaj6aemzfze66i/twu4mdnoqfrtusw6vszzcmgezzyw4wtdratwd5wdchdopyuuzrq b/.inductor_cache/fxgraph/vk/fvk4ttkukuswglvaw4ip7pgylylatakntngybzkaj6aemzfze66i/twu4mdnoqfrtusw6vszzcmgezzyw4wtdratwd5wdchdopyuuzrq new file mode 100644 index 0000000000000000000000000000000000000000..ad9a063df60e9b470dc792273aed9b8cb357cf56 --- /dev/null +++ b/.inductor_cache/fxgraph/vk/fvk4ttkukuswglvaw4ip7pgylylatakntngybzkaj6aemzfze66i/twu4mdnoqfrtusw6vszzcmgezzyw4wtdratwd5wdchdopyuuzrq @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9da9c60dae81633a4adeacb39130c4ce716e5a63882761f6c311c6e7e294cc60 +size 179704 diff --git a/.inductor_cache/fxgraph/vr/fvrlcvjtuen5ce3xe4s5xyzx5uhgio5qhvr5vimbsisyzzezyjoi/nzlhk6hbq5qusxfcflozbbih6ugfenexqyygciu46vk3agzoaah b/.inductor_cache/fxgraph/vr/fvrlcvjtuen5ce3xe4s5xyzx5uhgio5qhvr5vimbsisyzzezyjoi/nzlhk6hbq5qusxfcflozbbih6ugfenexqyygciu46vk3agzoaah new file mode 100644 index 0000000000000000000000000000000000000000..eec1ac23f1f32f7a1cf798bb260b5b6a45daeb5e --- /dev/null +++ b/.inductor_cache/fxgraph/vr/fvrlcvjtuen5ce3xe4s5xyzx5uhgio5qhvr5vimbsisyzzezyjoi/nzlhk6hbq5qusxfcflozbbih6ugfenexqyygciu46vk3agzoaah @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6e567578e18761495ca22add908507f50c523497863061229cf555b01b2e000e +size 109104 diff --git a/.inductor_cache/fxgraph/w2/fw26sxbkwjeisv22ocikt6okyblb43m7w5l577hrh7xv4pzkf7rz/lgsrmlwgnwnsp6cd6f56gvognp3wrbdxv6jh6t6tzjimx65stlz b/.inductor_cache/fxgraph/w2/fw26sxbkwjeisv22ocikt6okyblb43m7w5l577hrh7xv4pzkf7rz/lgsrmlwgnwnsp6cd6f56gvognp3wrbdxv6jh6t6tzjimx65stlz new file mode 100644 index 0000000000000000000000000000000000000000..4c1c425f59d06d6439868f77fd63fd959584d073 --- /dev/null +++ b/.inductor_cache/fxgraph/w2/fw26sxbkwjeisv22ocikt6okyblb43m7w5l577hrh7xv4pzkf7rz/lgsrmlwgnwnsp6cd6f56gvognp3wrbdxv6jh6t6tzjimx65stlz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:59a5162ec66d9b27f843f17be355c66bf7688477af927f4fd3ca50cbfbb29af2 +size 157777 diff --git a/.inductor_cache/fxgraph/w3/fw3vwt7ugdqczelrega5shfk6tpyzyqw6zizwfselm2d3rihpgsq/ghouqlm7v3akgutqrlsfcx3yambkes6vy3al43za27rmsj3y67i b/.inductor_cache/fxgraph/w3/fw3vwt7ugdqczelrega5shfk6tpyzyqw6zizwfselm2d3rihpgsq/ghouqlm7v3akgutqrlsfcx3yambkes6vy3al43za27rmsj3y67i new file mode 100644 index 0000000000000000000000000000000000000000..bf8d69568deba6e6f3debb89a0f932df593fd0e9 --- /dev/null +++ b/.inductor_cache/fxgraph/w3/fw3vwt7ugdqczelrega5shfk6tpyzyqw6zizwfselm2d3rihpgsq/ghouqlm7v3akgutqrlsfcx3yambkes6vy3al43za27rmsj3y67i @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:31dd482d9faec0a352708ae4515f780302a24bd5c6c0be6f20d7e2c92778f7d1 +size 159586 diff --git a/.inductor_cache/fxgraph/wt/fwtj4u6pa5amwmeipho73lszaea6ajx5nyyls4fk3duc6rtuz74y/korl4oezyklb3shxaysuepq4dqg2jpwfczct6wqyv2np2ouysqg b/.inductor_cache/fxgraph/wt/fwtj4u6pa5amwmeipho73lszaea6ajx5nyyls4fk3duc6rtuz74y/korl4oezyklb3shxaysuepq4dqg2jpwfczct6wqyv2np2ouysqg new file mode 100644 index 0000000000000000000000000000000000000000..87ee545e80c76897ad29785095b7bf83cb9218f2 --- /dev/null +++ b/.inductor_cache/fxgraph/wt/fwtj4u6pa5amwmeipho73lszaea6ajx5nyyls4fk3duc6rtuz74y/korl4oezyklb3shxaysuepq4dqg2jpwfczct6wqyv2np2ouysqg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:53a2be3899c2961dc8f70625423e1c1c0da4bec516453f5a18ae9afd3a98940d +size 276847 diff --git a/.inductor_cache/fxgraph/wt/fwtoi2rc3lztzosc7arolonc6v5y2u6nnqmprgkejo2yfl3xpa6m/c4rwj3eelqkqlmpmwkzca7dkinnkxdkivxti66phwfn4tjcre4u b/.inductor_cache/fxgraph/wt/fwtoi2rc3lztzosc7arolonc6v5y2u6nnqmprgkejo2yfl3xpa6m/c4rwj3eelqkqlmpmwkzca7dkinnkxdkivxti66phwfn4tjcre4u new file mode 100644 index 0000000000000000000000000000000000000000..e5444d70d69e557e3d66cba2545e3af5348fce5e --- /dev/null +++ b/.inductor_cache/fxgraph/wt/fwtoi2rc3lztzosc7arolonc6v5y2u6nnqmprgkejo2yfl3xpa6m/c4rwj3eelqkqlmpmwkzca7dkinnkxdkivxti66phwfn4tjcre4u @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:172364ec845c1505b1ecb2b2207c6a435aab8d48ade68f79e7b15bc9a4512728 +size 159554 diff --git a/.inductor_cache/fxgraph/wu/fwu7bnrmso6yhy2arf5wshnytvimb3ndhhvytkurzfdjatdtamuv/ofbwi6kbvxzp5swea6r7eacbfrj2igqxg4ut7ltkt7rxuk6i3il b/.inductor_cache/fxgraph/wu/fwu7bnrmso6yhy2arf5wshnytvimb3ndhhvytkurzfdjatdtamuv/ofbwi6kbvxzp5swea6r7eacbfrj2igqxg4ut7ltkt7rxuk6i3il new file mode 100644 index 0000000000000000000000000000000000000000..661ba85f95f2636cd8b3a2cf6fce1eda73b052d2 --- /dev/null +++ b/.inductor_cache/fxgraph/wu/fwu7bnrmso6yhy2arf5wshnytvimb3ndhhvytkurzfdjatdtamuv/ofbwi6kbvxzp5swea6r7eacbfrj2igqxg4ut7ltkt7rxuk6i3il @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7143647941adf2fecac407a3f200412c53a41a1737293fae6a9fe37a2bc8da17 +size 179719 diff --git a/.inductor_cache/fxgraph/xa/fxacl2dougxatc6gweidew5v7tp5dbyvditoxaxsgfvj7o5oocgg/4ccfvhcub76oeup5stp6muqm6pvtwisoe6h42dtklsuqqgrinnx b/.inductor_cache/fxgraph/xa/fxacl2dougxatc6gweidew5v7tp5dbyvditoxaxsgfvj7o5oocgg/4ccfvhcub76oeup5stp6muqm6pvtwisoe6h42dtklsuqqgrinnx new file mode 100644 index 0000000000000000000000000000000000000000..e733aa84a02b2919fe9b01f4908b56c566c05ec6 --- /dev/null +++ b/.inductor_cache/fxgraph/xa/fxacl2dougxatc6gweidew5v7tp5dbyvditoxaxsgfvj7o5oocgg/4ccfvhcub76oeup5stp6muqm6pvtwisoe6h42dtklsuqqgrinnx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e0845a9c540ffce251fd94dfe6520cf3eb3b224e278fcd0e6a5ca9081a286b6e +size 159554 diff --git a/.inductor_cache/fxgraph/xs/fxs7q46xfjgwlm2mtpzms3xlqzmg2wgykml4z7xw5vmmrky2izdc/pn3ijnygbkb6qm62n5v6wuxglcn5qptnzv2u477zs2qxd6k6zjn b/.inductor_cache/fxgraph/xs/fxs7q46xfjgwlm2mtpzms3xlqzmg2wgykml4z7xw5vmmrky2izdc/pn3ijnygbkb6qm62n5v6wuxglcn5qptnzv2u477zs2qxd6k6zjn new file mode 100644 index 0000000000000000000000000000000000000000..043b9f362d2d7724b89628dc15003d3748464620 --- /dev/null +++ b/.inductor_cache/fxgraph/xs/fxs7q46xfjgwlm2mtpzms3xlqzmg2wgykml4z7xw5vmmrky2izdc/pn3ijnygbkb6qm62n5v6wuxglcn5qptnzv2u477zs2qxd6k6zjn @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7b7684b7060a83e833da6f6beb52e6589bd83e6dcd754e7ff996a171f95eca5a +size 147452 diff --git a/.inductor_cache/fxgraph/yv/fyvho4fyxbniuj7umghbjfmsrcil4pcrbta7vtya27ebzcvrb556/vr7xaiqnyugmewuayz3rwdapp43vlxdc5oo5ntpmewi4rqfx4di b/.inductor_cache/fxgraph/yv/fyvho4fyxbniuj7umghbjfmsrcil4pcrbta7vtya27ebzcvrb556/vr7xaiqnyugmewuayz3rwdapp43vlxdc5oo5ntpmewi4rqfx4di new file mode 100644 index 0000000000000000000000000000000000000000..8439e5d73da1dd160c9f9756234ec9afcf428215 --- /dev/null +++ b/.inductor_cache/fxgraph/yv/fyvho4fyxbniuj7umghbjfmsrcil4pcrbta7vtya27ebzcvrb556/vr7xaiqnyugmewuayz3rwdapp43vlxdc5oo5ntpmewi4rqfx4di @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ac7f70220dc50cc25a80c6771b0c0f7f3755dc62eb9dd6cdec2591c8c0b7e0d0 +size 256822 diff --git a/.inductor_cache/fxgraph/z5/fz5cfzg3d2v4svansdpd3hs7rwl2u6o7p4pdpl3lf2l7ud3ssg5r/hq6pnvrtohnpiryufzsw44gqtvqouqhose3rjazknbi6sy5av6w b/.inductor_cache/fxgraph/z5/fz5cfzg3d2v4svansdpd3hs7rwl2u6o7p4pdpl3lf2l7ud3ssg5r/hq6pnvrtohnpiryufzsw44gqtvqouqhose3rjazknbi6sy5av6w new file mode 100644 index 0000000000000000000000000000000000000000..eaf7a796b5d9bcc6462aa32cb9524af62a615888 --- /dev/null +++ b/.inductor_cache/fxgraph/z5/fz5cfzg3d2v4svansdpd3hs7rwl2u6o7p4pdpl3lf2l7ud3ssg5r/hq6pnvrtohnpiryufzsw44gqtvqouqhose3rjazknbi6sy5av6w @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3c3cf6d63371daf447142e656e70d09d60ea40ee913714832a6851e963a0afac +size 118484 diff --git a/.inductor_cache/fxgraph/zd/fzd3rnkf3bwdgpwk6niycf655fa54sjs37tkbuwjnbmhoxpmmgmf/pa3fytonqjrkdncfamlsmbiwwxjzmvhpdoh7fded53dm434l4nx b/.inductor_cache/fxgraph/zd/fzd3rnkf3bwdgpwk6niycf655fa54sjs37tkbuwjnbmhoxpmmgmf/pa3fytonqjrkdncfamlsmbiwwxjzmvhpdoh7fded53dm434l4nx new file mode 100644 index 0000000000000000000000000000000000000000..4ab06872f13a3019cfbbae1823c01823731fdfab --- /dev/null +++ b/.inductor_cache/fxgraph/zd/fzd3rnkf3bwdgpwk6niycf655fa54sjs37tkbuwjnbmhoxpmmgmf/pa3fytonqjrkdncfamlsmbiwwxjzmvhpdoh7fded53dm434l4nx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:78365c4dcd8262a1b4450317260516b5d39654ef1b8ff28c83eec6ce6f8be36f +size 118484 diff --git a/.inductor_cache/fxgraph/zh/fzhbpnmk5itw3wiswkiq63y4dl5retafqbwopn7nqotc7i33lb4x/g67at2g25bxgtd5hqmzc3ugihuu3tvtwa2j7xpuy4n6uuovxyg6 b/.inductor_cache/fxgraph/zh/fzhbpnmk5itw3wiswkiq63y4dl5retafqbwopn7nqotc7i33lb4x/g67at2g25bxgtd5hqmzc3ugihuu3tvtwa2j7xpuy4n6uuovxyg6 new file mode 100644 index 0000000000000000000000000000000000000000..1ddaa909e19eae4bdd2512d2a128fc3a0b1df832 --- /dev/null +++ b/.inductor_cache/fxgraph/zh/fzhbpnmk5itw3wiswkiq63y4dl5retafqbwopn7nqotc7i33lb4x/g67at2g25bxgtd5hqmzc3ugihuu3tvtwa2j7xpuy4n6uuovxyg6 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:37be09e8dae86e698fa783322dd0c83d29b9d6760693fbbe98e37d4a3ab7c1bc +size 256822 diff --git a/.inductor_cache/fxgraph/zm/fzm3jejfae77cwvz6m7mphwpa3zn6hojpk73hx3hlihlqkto3kas/w35cec2ogehzh7zizaokclxdcjcfwfgur56zhyfun3ibn2suh2b b/.inductor_cache/fxgraph/zm/fzm3jejfae77cwvz6m7mphwpa3zn6hojpk73hx3hlihlqkto3kas/w35cec2ogehzh7zizaokclxdcjcfwfgur56zhyfun3ibn2suh2b new file mode 100644 index 0000000000000000000000000000000000000000..c8355bf2469853d07fd7cde2a3b6993ebd5d86d8 --- /dev/null +++ b/.inductor_cache/fxgraph/zm/fzm3jejfae77cwvz6m7mphwpa3zn6hojpk73hx3hlihlqkto3kas/w35cec2ogehzh7zizaokclxdcjcfwfgur56zhyfun3ibn2suh2b @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b6fa220b4e310f93ff28c81ca12ee312445b14d48f7d93e0b46ed016ea543e82 +size 281515 diff --git a/.inductor_cache/g4/cg4t4fcfm5hlvonfd4amchwglcwllzheradho2vd5znatmwe7gda.py b/.inductor_cache/g4/cg4t4fcfm5hlvonfd4amchwglcwllzheradho2vd5znatmwe7gda.py new file mode 100644 index 0000000000000000000000000000000000000000..866b2a05aba74cfbb57fe59d1f93a4b50a75fc34 --- /dev/null +++ b/.inductor_cache/g4/cg4t4fcfm5hlvonfd4amchwglcwllzheradho2vd5znatmwe7gda.py @@ -0,0 +1,24 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8192}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*bf16', 'out_ptr0': '*bf16', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=5, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 36864}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask).to(tl.float32) + tl.store(out_ptr0 + (x0), tmp0, xmask) diff --git a/.inductor_cache/g4/e6f84317f6169c0b7534cbbc7de0e4c0e558285c44f165c4b293e4bf4eff574a.best_config b/.inductor_cache/g4/e6f84317f6169c0b7534cbbc7de0e4c0e558285c44f165c4b293e4bf4eff574a.best_config new file mode 100644 index 0000000000000000000000000000000000000000..bfe3f8d2f7854ce195ee49a8736cc08ebde50dc4 --- /dev/null +++ b/.inductor_cache/g4/e6f84317f6169c0b7534cbbc7de0e4c0e558285c44f165c4b293e4bf4eff574a.best_config @@ -0,0 +1 @@ +{"XBLOCK": 128, "num_warps": 4, "num_stages": 1, "configs_hash": "1b2cc4dbebb9680d3ce31843331593b159e4046c056f195ca1ccf2464d5b37d1", "found_by_coordesc": false, "time_taken_ms": 31, "triton_cache_hash": "JO6EURS6OPPIJNQKRKLRTFGE6YEGGS4IKHEPZFQNLCS72U34VJOQ"} \ No newline at end of file diff --git a/.inductor_cache/gc/cgclcmrkxnap7phuhnd6fnbh2op7rlfchsr3yjcry4wmrbxlmnk2.py b/.inductor_cache/gc/cgclcmrkxnap7phuhnd6fnbh2op7rlfchsr3yjcry4wmrbxlmnk2.py new file mode 100644 index 0000000000000000000000000000000000000000..25cdf4e7380dc03f09979e45dd54c4f91ae54ead --- /dev/null +++ b/.inductor_cache/gc/cgclcmrkxnap7phuhnd6fnbh2op7rlfchsr3yjcry4wmrbxlmnk2.py @@ -0,0 +1,24 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8}, + filename=__file__, + triton_meta={'signature': {'out_ptr0': '*i64', 'ks0': 'i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=6, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_max_view_3', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 0, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 128}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_max_view_3(out_ptr0, ks0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = ks0 + tl.store(out_ptr0 + (x0), tmp0, xmask) diff --git a/.inductor_cache/gh/cgh3h66kh6zmglpmrlx6htv3pxncwpzk7nib6u5gncidhbtgezxu.py b/.inductor_cache/gh/cgh3h66kh6zmglpmrlx6htv3pxncwpzk7nib6u5gncidhbtgezxu.py new file mode 100644 index 0000000000000000000000000000000000000000..88982ef4f76893c7cb9484c7c435b71930a70a2f --- /dev/null +++ b/.inductor_cache/gh/cgh3h66kh6zmglpmrlx6htv3pxncwpzk7nib6u5gncidhbtgezxu.py @@ -0,0 +1,289 @@ +# AOT ID: ['6_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/r5/cr5stpc42p6e7gax2rhgvljylqkx5emjgqht2op5w5hwiihekryz.py +# Topologically Sorted Source Nodes: [unsqueeze, view, expand_scores, flatten, max_1], Original ATen: [aten.unsqueeze, aten.view, aten.mul, aten.max] +# Source node to ATen node mapping: +# expand_scores => mul_3 +# flatten => view_1 +# max_1 => getitem, max_1 +# unsqueeze => unsqueeze +# view => view +# Graph fragment: +# %arg2_1 : Tensor "f32[s97, 1][1, 1]cuda:2" = PlaceHolder[target=arg2_1] +# %arg3_1 : Tensor "f32[s97, 1][1, 1]cuda:2" = PlaceHolder[target=arg3_1] +# %mul_3 : Tensor "f32[s97, 1, 1][1, 1, 1]cuda:2" = PlaceHolder[target=mul_3] +# %unsqueeze : Tensor "f32[s97, 1, 1][1, 1, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%arg2_1, 2), kwargs = {}) +# %view : Tensor "f32[s97, 1, 1][1, 1, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%arg3_1, [-1, 1, 1]), kwargs = {}) +# %mul_3 : Tensor "f32[s97, 1, 1][1, 1, 1]cuda:2"[num_users=2] = call_function[target=torch.ops.aten.mul.Tensor](args = (%unsqueeze, %view), kwargs = {}) +# %view_1 : Tensor "f32[s97, 1][1, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg1_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %getitem : Tensor "f32[s97, 1][1, 1]cuda:2"[num_users=1] = call_function[target=operator.getitem](args = (%max_1, 0), kwargs = {}) +# return %mul_3,%getitem +triton_poi_fused_max_mul_unsqueeze_view_0 = async_compile.triton('triton_poi_fused_max_mul_unsqueeze_view_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'out_ptr0': '*fp32', 'out_ptr1': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=2, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_max_mul_unsqueeze_view_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 2, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 192}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_max_mul_unsqueeze_view_0(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp2 = tmp0 * tmp1 + tl.store(out_ptr0 + (x0), tmp2, xmask) + tl.store(out_ptr1 + (x0), tmp2, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/wv/cwv4bhf4zja523ayx77cdw4dkzcexjyttmndegvltrh5pklgztw2.py +# Topologically Sorted Source Nodes: [flatten, max_1, gather], Original ATen: [aten.view, aten.max, aten.gather] +# Source node to ATen node mapping: +# flatten => view_1 +# gather => gather +# max_1 => max_1 +# Graph fragment: +# %arg4_1 : Tensor "i64[s97, 1][1, 1]cuda:2" = PlaceHolder[target=arg4_1] +# %view_1 : Tensor "f32[s97, 1][1, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg1_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %gather : Tensor "i64[s97, 1][1, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.gather.default](args = (%arg4_1, 1, %getitem_1), kwargs = {}) +# return %gather +triton_poi_fused_gather_max_view_1 = async_compile.triton('triton_poi_fused_gather_max_view_1', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=2, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_gather_max_view_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 192}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_gather_max_view_1(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tl.store(out_ptr0 + (x0), tmp0, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/wi/cwiqfcswhex7vhj7ibleyueyqjfnmbmvnwp4neq7ywlmz4gnod3j.py +# Topologically Sorted Source Nodes: [flatten, max_1, flat_cs, floordiv, batch_offsets, repeat_interleave, selected_input_index, hidden_states], Original ATen: [aten.view, aten.max, aten.floor_divide, aten.arange, aten.unsqueeze, aten.add, aten.index] +# Source node to ATen node mapping: +# batch_offsets => iota +# flat_cs => view_4 +# flatten => view_1 +# floordiv => div +# hidden_states => index +# max_1 => max_1 +# repeat_interleave => unsqueeze_1, view_5 +# selected_input_index => add_47 +# Graph fragment: +# %arg6_1 : Tensor "bf16[s97, s87][s87, 1]cuda:2" = PlaceHolder[target=arg6_1] +# %view_1 : Tensor "f32[s97, 1][1, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg1_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %view_4 : Tensor "i64[s97][1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%getitem_1, [%arg1_1]), kwargs = {}) +# %div : Tensor "i64[s97][1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.div.Tensor_mode](args = (%view_4, 1), kwargs = {rounding_mode: floor}) +# %iota : Tensor "i64[s97][1]cuda:2"[num_users=1] = call_function[target=torch.ops.prims.iota.default](args = (%arg1_1,), kwargs = {start: 0, step: 1, dtype: torch.int64, device: cuda:2, requires_grad: False}) +# %unsqueeze_1 : Tensor "i64[s97, 1][1, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%iota, 1), kwargs = {}) +# %view_5 : Tensor "i64[s97][1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%expand, [%arg1_1]), kwargs = {}) +# %add_47 : Tensor "i64[s97][1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%div, %view_5), kwargs = {}) +# %index : Tensor "bf16[s97, s87][s87, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.index.Tensor](args = (%arg6_1, [%add_47]), kwargs = {}) +# return %index +triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2 = async_compile.triton('triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 65536}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*bf16', 'out_ptr0': '*bf16', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=2, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 294912}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x2 = xindex + tmp0 = tl.load(in_ptr0 + (x2), xmask, eviction_policy='evict_last').to(tl.float32) + tl.store(out_ptr0 + (x2), tmp0, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/f5/cf5tdx3gnxtntosmkamwgpfawabhai5ev6kn6ewzs2f6jcc5k3yw.py +# Topologically Sorted Source Nodes: [flatten, max_1, add_2], Original ATen: [aten.view, aten.max, aten.add] +# Source node to ATen node mapping: +# add_2 => add_53 +# flatten => view_1 +# max_1 => max_1 +# Graph fragment: +# %view_1 : Tensor "f32[s97, 1][1, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg1_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %add_53 : Tensor "i64[s97, 1][1, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%getitem_1, %arg7_1), kwargs = {}) +# return %add_53 +triton_poi_fused_add_max_view_3 = async_compile.triton('triton_poi_fused_add_max_view_3', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8}, + filename=__file__, + triton_meta={'signature': {'out_ptr0': '*i64', 'ks0': 'i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=2, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_max_view_3', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 0, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 128}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_max_view_3(out_ptr0, ks0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = ks0 + tl.store(out_ptr0 + (x0), tmp0, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1, arg7_1 = args + args.clear() + s53 = arg0_1 + s97 = arg1_1 + s87 = arg5_1 + s77 = arg7_1 + assert_size_stride(arg2_1, (s97, 1), (1, 1)) + assert_size_stride(arg3_1, (s97, 1), (1, 1)) + assert_size_stride(arg4_1, (s97, 1), (1, 1)) + assert_size_stride(arg6_1, (s97, s87), (s87, 1)) + with torch.cuda._DeviceGuard(2): + torch.cuda.set_device(2) + buf0 = empty_strided_cuda((s97, 1, 1), (1, 1, 1), torch.float32) + buf1 = empty_strided_cuda((s97, 1), (1, 1), torch.float32) + # Topologically Sorted Source Nodes: [unsqueeze, view, expand_scores, flatten, max_1], Original ATen: [aten.unsqueeze, aten.view, aten.mul, aten.max] + stream2 = get_raw_stream(2) + triton_poi_fused_max_mul_unsqueeze_view_0.run(arg2_1, arg3_1, buf0, buf1, s97, stream=stream2) + del arg2_1 + del arg3_1 + buf2 = empty_strided_cuda((s97, 1), (1, 1), torch.int64) + # Topologically Sorted Source Nodes: [flatten, max_1, gather], Original ATen: [aten.view, aten.max, aten.gather] + stream2 = get_raw_stream(2) + triton_poi_fused_gather_max_view_1.run(arg4_1, buf2, s97, stream=stream2) + buf3 = empty_strided_cuda((s97, s87), (s87, 1), torch.bfloat16) + # Topologically Sorted Source Nodes: [flatten, max_1, flat_cs, floordiv, batch_offsets, repeat_interleave, selected_input_index, hidden_states], Original ATen: [aten.view, aten.max, aten.floor_divide, aten.arange, aten.unsqueeze, aten.add, aten.index] + triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2_xnumel = s87*s97 + stream2 = get_raw_stream(2) + triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2.run(arg6_1, buf3, triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2_xnumel, stream=stream2) + del arg6_1 + buf4 = empty_strided_cuda((s97, 1), (1, 1), torch.int64) + # Topologically Sorted Source Nodes: [flatten, max_1, add_2], Original ATen: [aten.view, aten.max, aten.add] + stream2 = get_raw_stream(2) + triton_poi_fused_add_max_view_3.run(buf4, s77, s97, stream=stream2) + return (reinterpret_tensor(buf2, (s97, ), (1, ), 0), buf3, buf1, buf0, arg4_1, buf4, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = 1 + arg1_1 = 8 + arg2_1 = rand_strided((8, 1), (1, 1), device='cuda:2', dtype=torch.float32) + arg3_1 = rand_strided((8, 1), (1, 1), device='cuda:2', dtype=torch.float32) + arg4_1 = rand_strided((8, 1), (1, 1), device='cuda:2', dtype=torch.int64) + arg5_1 = 6144 + arg6_1 = rand_strided((8, 6144), (6144, 1), device='cuda:2', dtype=torch.bfloat16) + arg7_1 = 1 + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1, arg7_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/gk/cgklxkfsup6sp5i2de525how5cps54e7gazp2nra67ocunfdqr6q.py b/.inductor_cache/gk/cgklxkfsup6sp5i2de525how5cps54e7gazp2nra67ocunfdqr6q.py new file mode 100644 index 0000000000000000000000000000000000000000..6ee6e35eae59309e0f306f57f62d536f92fe6f20 --- /dev/null +++ b/.inductor_cache/gk/cgklxkfsup6sp5i2de525how5cps54e7gazp2nra67ocunfdqr6q.py @@ -0,0 +1,37 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i1', 'ks0': 'i64', 'ks1': 'i64', 'ks2': 'i64', 'ks3': 'i64', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=7, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_bitwise_and_bitwise_not_bitwise_or_ge_lt_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_bitwise_and_bitwise_not_bitwise_or_ge_lt_1(in_ptr0, out_ptr0, ks0, ks1, ks2, ks3, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = tl.load(in_ptr0 + (0)) + tmp1 = tl.broadcast_to(tmp0, [XBLOCK]) + tmp2 = ks0 + tmp3 = tmp1 >= tmp2 + tmp4 = ks1 + tmp5 = tmp1 < tmp4 + tmp6 = tmp3 & tmp5 + tmp7 = ks2 + tmp8 = tmp1 >= tmp7 + tmp9 = ks3 + tmp10 = tmp1 < tmp9 + tmp11 = tmp8 & tmp10 + tmp12 = tmp6 | tmp11 + tmp13 = tmp12 == 0 + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp13, None) diff --git a/.inductor_cache/go/cgosta3qier5lklv556fli53hw44q2ihtuzrbisvk6wf7h4rjyxo.py b/.inductor_cache/go/cgosta3qier5lklv556fli53hw44q2ihtuzrbisvk6wf7h4rjyxo.py new file mode 100644 index 0000000000000000000000000000000000000000..86a303cf18d2efc444bcdf5806110a859e09388b --- /dev/null +++ b/.inductor_cache/go/cgosta3qier5lklv556fli53hw44q2ihtuzrbisvk6wf7h4rjyxo.py @@ -0,0 +1,237 @@ +# AOT ID: ['8_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/5z/c5ztwyl3hjethlv2ot2kpnvlbaqjstzofdcjttbjwa7nkglx5gan.py +# Topologically Sorted Source Nodes: [ge, lt, org_vocab_mask, ge_1, lt_1, added_vocab_mask, vocab_mask, mul, mul_1, valid_offset, sub_3, input_], Original ATen: [aten.ge, aten.lt, aten.bitwise_and, aten.bitwise_or, aten.mul, aten.add, aten.sub] +# Source node to ATen node mapping: +# added_vocab_mask => bitwise_and_1 +# ge => ge +# ge_1 => ge_1 +# input_ => mul_2 +# lt => lt +# lt_1 => lt_1 +# mul => mul +# mul_1 => mul_1 +# org_vocab_mask => bitwise_and +# sub_3 => sub_3 +# valid_offset => add +# vocab_mask => bitwise_or +# Graph fragment: +# %arg0_1 : Tensor "i64[1][1]cuda:5" = PlaceHolder[target=arg0_1] +# %ge : Tensor "b8[1][1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.ge.Scalar](args = (%arg0_1, %arg1_1), kwargs = {}) +# %lt : Tensor "b8[1][1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.lt.Scalar](args = (%arg0_1, %arg2_1), kwargs = {}) +# %bitwise_and : Tensor "b8[1][1]cuda:5"[num_users=2] = call_function[target=torch.ops.aten.bitwise_and.Tensor](args = (%ge, %lt), kwargs = {}) +# %ge_1 : Tensor "b8[1][1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.ge.Scalar](args = (%arg0_1, %arg3_1), kwargs = {}) +# %lt_1 : Tensor "b8[1][1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.lt.Scalar](args = (%arg0_1, %arg4_1), kwargs = {}) +# %bitwise_and_1 : Tensor "b8[1][1]cuda:5"[num_users=2] = call_function[target=torch.ops.aten.bitwise_and.Tensor](args = (%ge_1, %lt_1), kwargs = {}) +# %bitwise_or : Tensor "b8[1][1]cuda:5"[num_users=2] = call_function[target=torch.ops.aten.bitwise_or.Tensor](args = (%bitwise_and, %bitwise_and_1), kwargs = {}) +# %mul : Tensor "i64[1][1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%bitwise_and, %arg1_1), kwargs = {}) +# %mul_1 : Tensor "i64[1][1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%bitwise_and_1, %sub_2), kwargs = {}) +# %add : Tensor "i64[1][1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%mul, %mul_1), kwargs = {}) +# %sub_3 : Tensor "i64[1][1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%arg0_1, %add), kwargs = {}) +# %mul_2 : Tensor "i64[1][1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%bitwise_or, %sub_3), kwargs = {}) +# return %mul_2 +triton_poi_fused_add_bitwise_and_bitwise_or_ge_lt_mul_sub_0 = async_compile.triton('triton_poi_fused_add_bitwise_and_bitwise_or_ge_lt_mul_sub_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'ks0': 'i64', 'ks1': 'i64', 'ks2': 'i64', 'ks3': 'i64', 'ks4': 'i64', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=5, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_bitwise_and_bitwise_or_ge_lt_mul_sub_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_bitwise_and_bitwise_or_ge_lt_mul_sub_0(in_ptr0, out_ptr0, ks0, ks1, ks2, ks3, ks4, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = tl.load(in_ptr0 + (0)) + tmp1 = tl.broadcast_to(tmp0, [XBLOCK]) + tmp2 = ks0 + tmp3 = tmp1 >= tmp2 + tmp4 = ks1 + tmp5 = tmp1 < tmp4 + tmp6 = tmp3 & tmp5 + tmp7 = ks2 + tmp8 = tmp1 >= tmp7 + tmp9 = ks3 + tmp10 = tmp1 < tmp9 + tmp11 = tmp8 & tmp10 + tmp12 = tmp6 | tmp11 + tmp13 = tmp12.to(tl.int64) + tmp14 = tmp6.to(tl.int64) + tmp15 = tmp14 * tmp2 + tmp16 = tmp11.to(tl.int64) + tmp17 = ks0 + ks2 + ((-1)*ks1) + ((-1)*ks4) + tmp18 = tmp16 * tmp17 + tmp19 = tmp15 + tmp18 + tmp20 = tmp1 - tmp19 + tmp21 = tmp13 * tmp20 + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp21, None) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/5d/c5dllvj5zhsrbv5yhs4lnnrfdo5t7vsfkgewb73jsq5ipppt5rbn.py +# Topologically Sorted Source Nodes: [ge, lt, org_vocab_mask, ge_1, lt_1, added_vocab_mask, vocab_mask, invert], Original ATen: [aten.ge, aten.lt, aten.bitwise_and, aten.bitwise_or, aten.bitwise_not] +# Source node to ATen node mapping: +# added_vocab_mask => bitwise_and_1 +# ge => ge +# ge_1 => ge_1 +# invert => bitwise_not +# lt => lt +# lt_1 => lt_1 +# org_vocab_mask => bitwise_and +# vocab_mask => bitwise_or +# Graph fragment: +# %arg0_1 : Tensor "i64[1][1]cuda:5" = PlaceHolder[target=arg0_1] +# %ge : Tensor "b8[1][1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.ge.Scalar](args = (%arg0_1, %arg1_1), kwargs = {}) +# %lt : Tensor "b8[1][1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.lt.Scalar](args = (%arg0_1, %arg2_1), kwargs = {}) +# %bitwise_and : Tensor "b8[1][1]cuda:5"[num_users=2] = call_function[target=torch.ops.aten.bitwise_and.Tensor](args = (%ge, %lt), kwargs = {}) +# %ge_1 : Tensor "b8[1][1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.ge.Scalar](args = (%arg0_1, %arg3_1), kwargs = {}) +# %lt_1 : Tensor "b8[1][1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.lt.Scalar](args = (%arg0_1, %arg4_1), kwargs = {}) +# %bitwise_and_1 : Tensor "b8[1][1]cuda:5"[num_users=2] = call_function[target=torch.ops.aten.bitwise_and.Tensor](args = (%ge_1, %lt_1), kwargs = {}) +# %bitwise_or : Tensor "b8[1][1]cuda:5"[num_users=2] = call_function[target=torch.ops.aten.bitwise_or.Tensor](args = (%bitwise_and, %bitwise_and_1), kwargs = {}) +# %bitwise_not : Tensor "b8[1][1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.bitwise_not.default](args = (%bitwise_or,), kwargs = {}) +# return %bitwise_not +triton_poi_fused_bitwise_and_bitwise_not_bitwise_or_ge_lt_1 = async_compile.triton('triton_poi_fused_bitwise_and_bitwise_not_bitwise_or_ge_lt_1', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i1', 'ks0': 'i64', 'ks1': 'i64', 'ks2': 'i64', 'ks3': 'i64', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=5, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_bitwise_and_bitwise_not_bitwise_or_ge_lt_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_bitwise_and_bitwise_not_bitwise_or_ge_lt_1(in_ptr0, out_ptr0, ks0, ks1, ks2, ks3, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = tl.load(in_ptr0 + (0)) + tmp1 = tl.broadcast_to(tmp0, [XBLOCK]) + tmp2 = ks0 + tmp3 = tmp1 >= tmp2 + tmp4 = ks1 + tmp5 = tmp1 < tmp4 + tmp6 = tmp3 & tmp5 + tmp7 = ks2 + tmp8 = tmp1 >= tmp7 + tmp9 = ks3 + tmp10 = tmp1 < tmp9 + tmp11 = tmp8 & tmp10 + tmp12 = tmp6 | tmp11 + tmp13 = tmp12 == 0 + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp13, None) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1 = args + args.clear() + s90 = arg1_1 + s87 = arg2_1 + s68 = arg3_1 + s53 = arg4_1 + s88 = arg5_1 + assert_size_stride(arg0_1, (1, ), (1, )) + with torch.cuda._DeviceGuard(5): + torch.cuda.set_device(5) + buf0 = empty_strided_cuda((1, ), (1, ), torch.int64) + # Topologically Sorted Source Nodes: [ge, lt, org_vocab_mask, ge_1, lt_1, added_vocab_mask, vocab_mask, mul, mul_1, valid_offset, sub_3, input_], Original ATen: [aten.ge, aten.lt, aten.bitwise_and, aten.bitwise_or, aten.mul, aten.add, aten.sub] + stream5 = get_raw_stream(5) + triton_poi_fused_add_bitwise_and_bitwise_or_ge_lt_mul_sub_0.run(arg0_1, buf0, s90, s87, s68, s53, s88, 1, stream=stream5) + buf1 = empty_strided_cuda((1, ), (1, ), torch.bool) + # Topologically Sorted Source Nodes: [ge, lt, org_vocab_mask, ge_1, lt_1, added_vocab_mask, vocab_mask, invert], Original ATen: [aten.ge, aten.lt, aten.bitwise_and, aten.bitwise_or, aten.bitwise_not] + stream5 = get_raw_stream(5) + triton_poi_fused_bitwise_and_bitwise_not_bitwise_or_ge_lt_1.run(arg0_1, buf1, s90, s87, s68, s53, 1, stream=stream5) + del arg0_1 + return (buf0, buf1, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = rand_strided((1, ), (1, ), device='cuda:5', dtype=torch.int64) + arg1_1 = 96800 + arg2_1 = 116160 + arg3_1 = 154880 + arg4_1 = 154880 + arg5_1 = 0 + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/gp/cgpokyocc7tdinfnb6opabr746t6knz5cgybj5fxyufsucoeojra.py b/.inductor_cache/gp/cgpokyocc7tdinfnb6opabr746t6knz5cgybj5fxyufsucoeojra.py new file mode 100644 index 0000000000000000000000000000000000000000..1546d6603ce03bf66d057be7efec1dabcd9b0094 --- /dev/null +++ b/.inductor_cache/gp/cgpokyocc7tdinfnb6opabr746t6knz5cgybj5fxyufsucoeojra.py @@ -0,0 +1,25 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=4, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_gather_max_view_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_gather_max_view_1(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = tl.load(in_ptr0 + (0)) + tmp1 = tl.broadcast_to(tmp0, [XBLOCK]) + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp1, None) diff --git a/.inductor_cache/gq/cgq3pa7prkzkg7dopohbjbppbqjml5ahjflv7kdd3v25rzopfamk.py b/.inductor_cache/gq/cgq3pa7prkzkg7dopohbjbppbqjml5ahjflv7kdd3v25rzopfamk.py new file mode 100644 index 0000000000000000000000000000000000000000..5bd48acc007b10ee9ebe019e1519b27fef7c2608 --- /dev/null +++ b/.inductor_cache/gq/cgq3pa7prkzkg7dopohbjbppbqjml5ahjflv7kdd3v25rzopfamk.py @@ -0,0 +1,237 @@ +# AOT ID: ['8_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/da/cdakniaakm6do4pgde7tzh3xnxqhlnjefychysegtvcanqz642tc.py +# Topologically Sorted Source Nodes: [ge, lt, org_vocab_mask, ge_1, lt_1, added_vocab_mask, vocab_mask, mul, mul_1, valid_offset, sub_3, input_], Original ATen: [aten.ge, aten.lt, aten.bitwise_and, aten.bitwise_or, aten.mul, aten.add, aten.sub] +# Source node to ATen node mapping: +# added_vocab_mask => bitwise_and_1 +# ge => ge +# ge_1 => ge_1 +# input_ => mul_2 +# lt => lt +# lt_1 => lt_1 +# mul => mul +# mul_1 => mul_1 +# org_vocab_mask => bitwise_and +# sub_3 => sub_3 +# valid_offset => add +# vocab_mask => bitwise_or +# Graph fragment: +# %arg0_1 : Tensor "i64[1][1]cuda:6" = PlaceHolder[target=arg0_1] +# %ge : Tensor "b8[1][1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.ge.Scalar](args = (%arg0_1, %arg1_1), kwargs = {}) +# %lt : Tensor "b8[1][1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.lt.Scalar](args = (%arg0_1, %arg2_1), kwargs = {}) +# %bitwise_and : Tensor "b8[1][1]cuda:6"[num_users=2] = call_function[target=torch.ops.aten.bitwise_and.Tensor](args = (%ge, %lt), kwargs = {}) +# %ge_1 : Tensor "b8[1][1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.ge.Scalar](args = (%arg0_1, %arg3_1), kwargs = {}) +# %lt_1 : Tensor "b8[1][1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.lt.Scalar](args = (%arg0_1, %arg4_1), kwargs = {}) +# %bitwise_and_1 : Tensor "b8[1][1]cuda:6"[num_users=2] = call_function[target=torch.ops.aten.bitwise_and.Tensor](args = (%ge_1, %lt_1), kwargs = {}) +# %bitwise_or : Tensor "b8[1][1]cuda:6"[num_users=2] = call_function[target=torch.ops.aten.bitwise_or.Tensor](args = (%bitwise_and, %bitwise_and_1), kwargs = {}) +# %mul : Tensor "i64[1][1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%bitwise_and, %arg1_1), kwargs = {}) +# %mul_1 : Tensor "i64[1][1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%bitwise_and_1, %sub_2), kwargs = {}) +# %add : Tensor "i64[1][1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%mul, %mul_1), kwargs = {}) +# %sub_3 : Tensor "i64[1][1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%arg0_1, %add), kwargs = {}) +# %mul_2 : Tensor "i64[1][1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%bitwise_or, %sub_3), kwargs = {}) +# return %mul_2 +triton_poi_fused_add_bitwise_and_bitwise_or_ge_lt_mul_sub_0 = async_compile.triton('triton_poi_fused_add_bitwise_and_bitwise_or_ge_lt_mul_sub_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'ks0': 'i64', 'ks1': 'i64', 'ks2': 'i64', 'ks3': 'i64', 'ks4': 'i64', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=6, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_bitwise_and_bitwise_or_ge_lt_mul_sub_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_bitwise_and_bitwise_or_ge_lt_mul_sub_0(in_ptr0, out_ptr0, ks0, ks1, ks2, ks3, ks4, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = tl.load(in_ptr0 + (0)) + tmp1 = tl.broadcast_to(tmp0, [XBLOCK]) + tmp2 = ks0 + tmp3 = tmp1 >= tmp2 + tmp4 = ks1 + tmp5 = tmp1 < tmp4 + tmp6 = tmp3 & tmp5 + tmp7 = ks2 + tmp8 = tmp1 >= tmp7 + tmp9 = ks3 + tmp10 = tmp1 < tmp9 + tmp11 = tmp8 & tmp10 + tmp12 = tmp6 | tmp11 + tmp13 = tmp12.to(tl.int64) + tmp14 = tmp6.to(tl.int64) + tmp15 = tmp14 * tmp2 + tmp16 = tmp11.to(tl.int64) + tmp17 = ks0 + ks2 + ((-1)*ks1) + ((-1)*ks4) + tmp18 = tmp16 * tmp17 + tmp19 = tmp15 + tmp18 + tmp20 = tmp1 - tmp19 + tmp21 = tmp13 * tmp20 + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp21, None) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/4i/c4iwhfgin6ac7qvqb6fj5msgdftp5qsxjv6sjxyuqbryq4qqwzfg.py +# Topologically Sorted Source Nodes: [ge, lt, org_vocab_mask, ge_1, lt_1, added_vocab_mask, vocab_mask, invert], Original ATen: [aten.ge, aten.lt, aten.bitwise_and, aten.bitwise_or, aten.bitwise_not] +# Source node to ATen node mapping: +# added_vocab_mask => bitwise_and_1 +# ge => ge +# ge_1 => ge_1 +# invert => bitwise_not +# lt => lt +# lt_1 => lt_1 +# org_vocab_mask => bitwise_and +# vocab_mask => bitwise_or +# Graph fragment: +# %arg0_1 : Tensor "i64[1][1]cuda:6" = PlaceHolder[target=arg0_1] +# %ge : Tensor "b8[1][1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.ge.Scalar](args = (%arg0_1, %arg1_1), kwargs = {}) +# %lt : Tensor "b8[1][1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.lt.Scalar](args = (%arg0_1, %arg2_1), kwargs = {}) +# %bitwise_and : Tensor "b8[1][1]cuda:6"[num_users=2] = call_function[target=torch.ops.aten.bitwise_and.Tensor](args = (%ge, %lt), kwargs = {}) +# %ge_1 : Tensor "b8[1][1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.ge.Scalar](args = (%arg0_1, %arg3_1), kwargs = {}) +# %lt_1 : Tensor "b8[1][1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.lt.Scalar](args = (%arg0_1, %arg4_1), kwargs = {}) +# %bitwise_and_1 : Tensor "b8[1][1]cuda:6"[num_users=2] = call_function[target=torch.ops.aten.bitwise_and.Tensor](args = (%ge_1, %lt_1), kwargs = {}) +# %bitwise_or : Tensor "b8[1][1]cuda:6"[num_users=2] = call_function[target=torch.ops.aten.bitwise_or.Tensor](args = (%bitwise_and, %bitwise_and_1), kwargs = {}) +# %bitwise_not : Tensor "b8[1][1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.bitwise_not.default](args = (%bitwise_or,), kwargs = {}) +# return %bitwise_not +triton_poi_fused_bitwise_and_bitwise_not_bitwise_or_ge_lt_1 = async_compile.triton('triton_poi_fused_bitwise_and_bitwise_not_bitwise_or_ge_lt_1', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i1', 'ks0': 'i64', 'ks1': 'i64', 'ks2': 'i64', 'ks3': 'i64', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=6, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_bitwise_and_bitwise_not_bitwise_or_ge_lt_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_bitwise_and_bitwise_not_bitwise_or_ge_lt_1(in_ptr0, out_ptr0, ks0, ks1, ks2, ks3, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = tl.load(in_ptr0 + (0)) + tmp1 = tl.broadcast_to(tmp0, [XBLOCK]) + tmp2 = ks0 + tmp3 = tmp1 >= tmp2 + tmp4 = ks1 + tmp5 = tmp1 < tmp4 + tmp6 = tmp3 & tmp5 + tmp7 = ks2 + tmp8 = tmp1 >= tmp7 + tmp9 = ks3 + tmp10 = tmp1 < tmp9 + tmp11 = tmp8 & tmp10 + tmp12 = tmp6 | tmp11 + tmp13 = tmp12 == 0 + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp13, None) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1 = args + args.clear() + s90 = arg1_1 + s87 = arg2_1 + s68 = arg3_1 + s53 = arg4_1 + s88 = arg5_1 + assert_size_stride(arg0_1, (1, ), (1, )) + with torch.cuda._DeviceGuard(6): + torch.cuda.set_device(6) + buf0 = empty_strided_cuda((1, ), (1, ), torch.int64) + # Topologically Sorted Source Nodes: [ge, lt, org_vocab_mask, ge_1, lt_1, added_vocab_mask, vocab_mask, mul, mul_1, valid_offset, sub_3, input_], Original ATen: [aten.ge, aten.lt, aten.bitwise_and, aten.bitwise_or, aten.mul, aten.add, aten.sub] + stream6 = get_raw_stream(6) + triton_poi_fused_add_bitwise_and_bitwise_or_ge_lt_mul_sub_0.run(arg0_1, buf0, s90, s87, s68, s53, s88, 1, stream=stream6) + buf1 = empty_strided_cuda((1, ), (1, ), torch.bool) + # Topologically Sorted Source Nodes: [ge, lt, org_vocab_mask, ge_1, lt_1, added_vocab_mask, vocab_mask, invert], Original ATen: [aten.ge, aten.lt, aten.bitwise_and, aten.bitwise_or, aten.bitwise_not] + stream6 = get_raw_stream(6) + triton_poi_fused_bitwise_and_bitwise_not_bitwise_or_ge_lt_1.run(arg0_1, buf1, s90, s87, s68, s53, 1, stream=stream6) + del arg0_1 + return (buf0, buf1, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = rand_strided((1, ), (1, ), device='cuda:6', dtype=torch.int64) + arg1_1 = 116160 + arg2_1 = 135520 + arg3_1 = 154880 + arg4_1 = 154880 + arg5_1 = 0 + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/gw/cgwacex6q4xcuihyyl5gz2vedp3npaqs75n6jriuhynzy7ceyzmv.py b/.inductor_cache/gw/cgwacex6q4xcuihyyl5gz2vedp3npaqs75n6jriuhynzy7ceyzmv.py new file mode 100644 index 0000000000000000000000000000000000000000..522e714efb5d8b4cebfdc63cba7ddc054d10772c --- /dev/null +++ b/.inductor_cache/gw/cgwacex6q4xcuihyyl5gz2vedp3npaqs75n6jriuhynzy7ceyzmv.py @@ -0,0 +1,291 @@ +# AOT ID: ['7_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/wu/cwuk5cadblqsicej65lgc3wdcpm3vt4hpedbi6eemxutq5pqhadk.py +# Topologically Sorted Source Nodes: [unsqueeze, view, expand_scores, flatten, max_1], Original ATen: [aten.unsqueeze, aten.view, aten.mul, aten.max] +# Source node to ATen node mapping: +# expand_scores => mul_3 +# flatten => view_1 +# max_1 => getitem, max_1 +# unsqueeze => unsqueeze +# view => view +# Graph fragment: +# %arg2_1 : Tensor "f32[s0, 1][1, 1]cuda:6" = PlaceHolder[target=arg2_1] +# %arg4_1 : Tensor "f32[s0, 1][1, 1]cuda:6" = PlaceHolder[target=arg4_1] +# %mul_3 : Tensor "f32[s0, 1, 1][1, 1, 1]cuda:6" = PlaceHolder[target=mul_3] +# %unsqueeze : Tensor "f32[s0, 1, 1][1, 1, 1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%arg2_1, 2), kwargs = {}) +# %view : Tensor "f32[s0, 1, 1][1, 1, 1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%arg4_1, [-1, 1, 1]), kwargs = {}) +# %mul_3 : Tensor "f32[s0, 1, 1][1, 1, 1]cuda:6"[num_users=2] = call_function[target=torch.ops.aten.mul.Tensor](args = (%unsqueeze, %view), kwargs = {}) +# %view_1 : Tensor "f32[s0, 1][1, 1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg3_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %getitem : Tensor "f32[s0, 1][1, 1]cuda:6"[num_users=1] = call_function[target=operator.getitem](args = (%max_1, 0), kwargs = {}) +# return %mul_3,%getitem +triton_poi_fused_max_mul_unsqueeze_view_0 = async_compile.triton('triton_poi_fused_max_mul_unsqueeze_view_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'out_ptr0': '*fp32', 'out_ptr1': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=6, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_max_mul_unsqueeze_view_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 2, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 192}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_max_mul_unsqueeze_view_0(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp2 = tmp0 * tmp1 + tl.store(out_ptr0 + (x0), tmp2, xmask) + tl.store(out_ptr1 + (x0), tmp2, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/au/cau6vi5aabrewtrihlehyopwe5sren7faqm7qila2g46bypj6mps.py +# Topologically Sorted Source Nodes: [flatten, max_1, gather], Original ATen: [aten.view, aten.max, aten.gather] +# Source node to ATen node mapping: +# flatten => view_1 +# gather => gather +# max_1 => max_1 +# Graph fragment: +# %arg5_1 : Tensor "i64[s0, 1][1, 1]cuda:6" = PlaceHolder[target=arg5_1] +# %view_1 : Tensor "f32[s0, 1][1, 1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg3_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %gather : Tensor "i64[s0, 1][1, 1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.gather.default](args = (%arg5_1, 1, %getitem_1), kwargs = {}) +# return %gather +triton_poi_fused_gather_max_view_1 = async_compile.triton('triton_poi_fused_gather_max_view_1', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=6, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_gather_max_view_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 192}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_gather_max_view_1(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tl.store(out_ptr0 + (x0), tmp0, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/tp/ctpdramlki7worghuqh4omu3ji5k4kbvd64yby4bnrj3is4m6q6g.py +# Topologically Sorted Source Nodes: [flatten, max_1, flat_cs, floordiv, batch_offsets, repeat_interleave, selected_input_index, hidden_states], Original ATen: [aten.view, aten.max, aten.floor_divide, aten.arange, aten.unsqueeze, aten.add, aten.index] +# Source node to ATen node mapping: +# batch_offsets => iota +# flat_cs => view_4 +# flatten => view_1 +# floordiv => div +# hidden_states => index +# max_1 => max_1 +# repeat_interleave => unsqueeze_1, view_5 +# selected_input_index => add_47 +# Graph fragment: +# %arg7_1 : Tensor "bf16[s0, s87][s87, 1]cuda:6" = PlaceHolder[target=arg7_1] +# %view_1 : Tensor "f32[s0, 1][1, 1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg3_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %view_4 : Tensor "i64[s0][1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%getitem_1, [%arg3_1]), kwargs = {}) +# %div : Tensor "i64[s0][1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.div.Tensor_mode](args = (%view_4, 1), kwargs = {rounding_mode: floor}) +# %iota : Tensor "i64[s0][1]cuda:6"[num_users=1] = call_function[target=torch.ops.prims.iota.default](args = (%arg3_1,), kwargs = {start: 0, step: 1, dtype: torch.int64, device: cuda:6, requires_grad: False}) +# %unsqueeze_1 : Tensor "i64[s0, 1][1, 1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%iota, 1), kwargs = {}) +# %view_5 : Tensor "i64[s0][1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%expand, [%arg3_1]), kwargs = {}) +# %add_47 : Tensor "i64[s0][1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%div, %view_5), kwargs = {}) +# %index : Tensor "bf16[s0, s87][s87, 1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.index.Tensor](args = (%arg7_1, [%add_47]), kwargs = {}) +# return %index +triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2 = async_compile.triton('triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 65536}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*bf16', 'out_ptr0': '*bf16', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=6, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 294912}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x2 = xindex + tmp0 = tl.load(in_ptr0 + (x2), xmask, eviction_policy='evict_last').to(tl.float32) + tl.store(out_ptr0 + (x2), tmp0, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/gc/cgclcmrkxnap7phuhnd6fnbh2op7rlfchsr3yjcry4wmrbxlmnk2.py +# Topologically Sorted Source Nodes: [flatten, max_1, add_2], Original ATen: [aten.view, aten.max, aten.add] +# Source node to ATen node mapping: +# add_2 => add_53 +# flatten => view_1 +# max_1 => max_1 +# Graph fragment: +# %view_1 : Tensor "f32[s0, 1][1, 1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg3_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %add_53 : Tensor "i64[s0, 1][1, 1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%getitem_1, %arg8_1), kwargs = {}) +# return %add_53 +triton_poi_fused_add_max_view_3 = async_compile.triton('triton_poi_fused_add_max_view_3', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8}, + filename=__file__, + triton_meta={'signature': {'out_ptr0': '*i64', 'ks0': 'i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=6, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_max_view_3', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 0, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 128}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_max_view_3(out_ptr0, ks0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = ks0 + tl.store(out_ptr0 + (x0), tmp0, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1, arg7_1, arg8_1 = args + args.clear() + s53 = arg0_1 + s68 = arg1_1 + s0 = arg3_1 + s87 = arg6_1 + s77 = arg8_1 + assert_size_stride(arg2_1, (s0, 1), (1, 1)) + assert_size_stride(arg4_1, (s0, 1), (1, 1)) + assert_size_stride(arg5_1, (s0, 1), (1, 1)) + assert_size_stride(arg7_1, (s0, s87), (s87, 1)) + with torch.cuda._DeviceGuard(6): + torch.cuda.set_device(6) + buf0 = empty_strided_cuda((s0, 1, 1), (1, 1, 1), torch.float32) + buf1 = empty_strided_cuda((s0, 1), (1, 1), torch.float32) + # Topologically Sorted Source Nodes: [unsqueeze, view, expand_scores, flatten, max_1], Original ATen: [aten.unsqueeze, aten.view, aten.mul, aten.max] + stream6 = get_raw_stream(6) + triton_poi_fused_max_mul_unsqueeze_view_0.run(arg2_1, arg4_1, buf0, buf1, s0, stream=stream6) + del arg2_1 + del arg4_1 + buf2 = empty_strided_cuda((s0, 1), (1, 1), torch.int64) + # Topologically Sorted Source Nodes: [flatten, max_1, gather], Original ATen: [aten.view, aten.max, aten.gather] + stream6 = get_raw_stream(6) + triton_poi_fused_gather_max_view_1.run(arg5_1, buf2, s0, stream=stream6) + buf3 = empty_strided_cuda((s0, s87), (s87, 1), torch.bfloat16) + # Topologically Sorted Source Nodes: [flatten, max_1, flat_cs, floordiv, batch_offsets, repeat_interleave, selected_input_index, hidden_states], Original ATen: [aten.view, aten.max, aten.floor_divide, aten.arange, aten.unsqueeze, aten.add, aten.index] + triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2_xnumel = s0*s87 + stream6 = get_raw_stream(6) + triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2.run(arg7_1, buf3, triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2_xnumel, stream=stream6) + del arg7_1 + buf4 = empty_strided_cuda((s0, 1), (1, 1), torch.int64) + # Topologically Sorted Source Nodes: [flatten, max_1, add_2], Original ATen: [aten.view, aten.max, aten.add] + stream6 = get_raw_stream(6) + triton_poi_fused_add_max_view_3.run(buf4, s77, s0, stream=stream6) + return (reinterpret_tensor(buf2, (s0, ), (1, ), 0), buf3, buf1, buf0, arg5_1, buf4, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = 1 + arg1_1 = 8 + arg2_1 = rand_strided((8, 1), (1, 1), device='cuda:6', dtype=torch.float32) + arg3_1 = 8 + arg4_1 = rand_strided((8, 1), (1, 1), device='cuda:6', dtype=torch.float32) + arg5_1 = rand_strided((8, 1), (1, 1), device='cuda:6', dtype=torch.int64) + arg6_1 = 6144 + arg7_1 = rand_strided((8, 6144), (6144, 1), device='cuda:6', dtype=torch.bfloat16) + arg8_1 = 2 + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1, arg7_1, arg8_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/h2/ch2tjpsje4bsde7z3a4ler2mxok6q34ylpe7gwpix3ujjkwxo6me.py b/.inductor_cache/h2/ch2tjpsje4bsde7z3a4ler2mxok6q34ylpe7gwpix3ujjkwxo6me.py new file mode 100644 index 0000000000000000000000000000000000000000..fae903a4ea1a26a735231790322aa34d4d59ea70 --- /dev/null +++ b/.inductor_cache/h2/ch2tjpsje4bsde7z3a4ler2mxok6q34ylpe7gwpix3ujjkwxo6me.py @@ -0,0 +1,24 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 2}, + filename=__file__, + triton_meta={'signature': {'out_ptr0': '*i64', 'ks0': 'i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=5, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_max_view_3', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 0, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 8}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_max_view_3(out_ptr0, ks0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = ks0 + tl.store(out_ptr0 + (x0), tmp0, xmask) diff --git a/.inductor_cache/hi/chi5coidnx6ytnjza4lr47ied42zfptxdahqyjwgazdsc2s5e4oq.py b/.inductor_cache/hi/chi5coidnx6ytnjza4lr47ied42zfptxdahqyjwgazdsc2s5e4oq.py new file mode 100644 index 0000000000000000000000000000000000000000..ae474e41824adef56c794320ca3f3e4337f3abee --- /dev/null +++ b/.inductor_cache/hi/chi5coidnx6ytnjza4lr47ied42zfptxdahqyjwgazdsc2s5e4oq.py @@ -0,0 +1,289 @@ +# AOT ID: ['11_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/yl/cylovplln3koptl7knbgjthwhumhpciqpqqmyetfypi5rqcz3aet.py +# Topologically Sorted Source Nodes: [unsqueeze, view, expand_scores, flatten, max_1], Original ATen: [aten.unsqueeze, aten.view, aten.mul, aten.max] +# Source node to ATen node mapping: +# expand_scores => mul_1 +# flatten => view_1 +# max_1 => getitem, max_1 +# unsqueeze => unsqueeze +# view => view +# Graph fragment: +# %arg1_1 : Tensor "f32[1, 1][1, 1]cuda:5" = PlaceHolder[target=arg1_1] +# %arg2_1 : Tensor "f32[1, 1][1, 1]cuda:5" = PlaceHolder[target=arg2_1] +# %mul_1 : Tensor "f32[1, 1, 1][1, 1, 1]cuda:5" = PlaceHolder[target=mul_1] +# %unsqueeze : Tensor "f32[1, 1, 1][1, 1, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%arg1_1, 2), kwargs = {}) +# %view : Tensor "f32[1, 1, 1][1, 1, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%arg2_1, [-1, 1, 1]), kwargs = {}) +# %mul_1 : Tensor "f32[1, 1, 1][1, 1, 1]cuda:5"[num_users=2] = call_function[target=torch.ops.aten.mul.Tensor](args = (%unsqueeze, %view), kwargs = {}) +# %view_1 : Tensor "f32[1, 1][1, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_1, [1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %getitem : Tensor "f32[1, 1][1, 1]cuda:5"[num_users=1] = call_function[target=operator.getitem](args = (%max_1, 0), kwargs = {}) +# return %mul_1,%getitem +triton_poi_fused_max_mul_unsqueeze_view_0 = async_compile.triton('triton_poi_fused_max_mul_unsqueeze_view_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'out_ptr0': '*fp32', 'out_ptr1': '*fp32', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=5, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_max_mul_unsqueeze_view_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 2, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_max_mul_unsqueeze_view_0(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = tl.load(in_ptr0 + (0)) + tmp1 = tl.broadcast_to(tmp0, [XBLOCK]) + tmp2 = tl.load(in_ptr1 + (0)) + tmp3 = tl.broadcast_to(tmp2, [XBLOCK]) + tmp4 = tmp1 * tmp3 + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp4, None) + tl.store(out_ptr1 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp4, None) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/ft/cft6n5c7hrt25hfqh7jjjcgw67qrmjx5smcrl6iun4jd2kw2i3ts.py +# Topologically Sorted Source Nodes: [flatten, max_1, gather], Original ATen: [aten.view, aten.max, aten.gather] +# Source node to ATen node mapping: +# flatten => view_1 +# gather => gather +# max_1 => max_1 +# Graph fragment: +# %arg3_1 : Tensor "i64[1, 1][1, 1]cuda:5" = PlaceHolder[target=arg3_1] +# %view_1 : Tensor "f32[1, 1][1, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_1, [1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %gather : Tensor "i64[1, 1][1, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.gather.default](args = (%arg3_1, 1, %getitem_1), kwargs = {}) +# return %gather +triton_poi_fused_gather_max_view_1 = async_compile.triton('triton_poi_fused_gather_max_view_1', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=5, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_gather_max_view_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_gather_max_view_1(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = tl.load(in_ptr0 + (0)) + tmp1 = tl.broadcast_to(tmp0, [XBLOCK]) + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp1, None) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/g4/cg4t4fcfm5hlvonfd4amchwglcwllzheradho2vd5znatmwe7gda.py +# Topologically Sorted Source Nodes: [flatten, max_1, flat_cs, floordiv, batch_offsets, repeat_interleave, selected_input_index, hidden_states], Original ATen: [aten.view, aten.max, aten.floor_divide, aten.arange, aten.unsqueeze, aten.add, aten.index] +# Source node to ATen node mapping: +# batch_offsets => iota +# flat_cs => view_4 +# flatten => view_1 +# floordiv => div +# hidden_states => index +# max_1 => max_1 +# repeat_interleave => unsqueeze_1, view_5 +# selected_input_index => add +# Graph fragment: +# %arg5_1 : Tensor "bf16[1, s87][s87, 1]cuda:5" = PlaceHolder[target=arg5_1] +# %view_1 : Tensor "f32[1, 1][1, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_1, [1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %view_4 : Tensor "i64[1][1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%getitem_1, [1]), kwargs = {}) +# %div : Tensor "i64[1][1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.div.Tensor_mode](args = (%view_4, 1), kwargs = {rounding_mode: floor}) +# %iota : Tensor "i64[1][1]cuda:5"[num_users=1] = call_function[target=torch.ops.prims.iota.default](args = (1,), kwargs = {start: 0, step: 1, dtype: torch.int64, device: cuda:5, requires_grad: False}) +# %unsqueeze_1 : Tensor "i64[1, 1][1, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%iota, 1), kwargs = {}) +# %view_5 : Tensor "i64[1][1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%expand, [1]), kwargs = {}) +# %add : Tensor "i64[1][1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%div, %view_5), kwargs = {}) +# %index : Tensor "bf16[1, s87][s87, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.index.Tensor](args = (%arg5_1, [%add]), kwargs = {}) +# return %index +triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2 = async_compile.triton('triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8192}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*bf16', 'out_ptr0': '*bf16', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=5, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 36864}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask).to(tl.float32) + tl.store(out_ptr0 + (x0), tmp0, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/5l/c5lhmqi55bmiwxrtdbnsnvjgutkpxgsd6sl2mrliaofj5ojwc2gs.py +# Topologically Sorted Source Nodes: [flatten, max_1, add_2], Original ATen: [aten.view, aten.max, aten.add] +# Source node to ATen node mapping: +# add_2 => add_3 +# flatten => view_1 +# max_1 => max_1 +# Graph fragment: +# %view_1 : Tensor "f32[1, 1][1, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_1, [1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %add_3 : Tensor "i64[1, 1][1, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%getitem_1, %arg6_1), kwargs = {}) +# return %add_3 +triton_poi_fused_add_max_view_3 = async_compile.triton('triton_poi_fused_add_max_view_3', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'out_ptr0': '*i64', 'ks0': 'i64', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=5, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_max_view_3', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 0, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_max_view_3(out_ptr0, ks0, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = ks0 + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32)), tmp0, None) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1 = args + args.clear() + s53 = arg0_1 + s87 = arg4_1 + s77 = arg6_1 + assert_size_stride(arg1_1, (1, 1), (1, 1)) + assert_size_stride(arg2_1, (1, 1), (1, 1)) + assert_size_stride(arg3_1, (1, 1), (1, 1)) + assert_size_stride(arg5_1, (1, s87), (s87, 1)) + with torch.cuda._DeviceGuard(5): + torch.cuda.set_device(5) + buf0 = empty_strided_cuda((1, 1, 1), (1, 1, 1), torch.float32) + buf1 = empty_strided_cuda((1, 1), (1, 1), torch.float32) + # Topologically Sorted Source Nodes: [unsqueeze, view, expand_scores, flatten, max_1], Original ATen: [aten.unsqueeze, aten.view, aten.mul, aten.max] + stream5 = get_raw_stream(5) + triton_poi_fused_max_mul_unsqueeze_view_0.run(arg1_1, arg2_1, buf0, buf1, 1, stream=stream5) + del arg1_1 + del arg2_1 + buf2 = empty_strided_cuda((1, 1), (1, 1), torch.int64) + # Topologically Sorted Source Nodes: [flatten, max_1, gather], Original ATen: [aten.view, aten.max, aten.gather] + stream5 = get_raw_stream(5) + triton_poi_fused_gather_max_view_1.run(arg3_1, buf2, 1, stream=stream5) + buf3 = empty_strided_cuda((1, s87), (s87, 1), torch.bfloat16) + # Topologically Sorted Source Nodes: [flatten, max_1, flat_cs, floordiv, batch_offsets, repeat_interleave, selected_input_index, hidden_states], Original ATen: [aten.view, aten.max, aten.floor_divide, aten.arange, aten.unsqueeze, aten.add, aten.index] + stream5 = get_raw_stream(5) + triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2.run(arg5_1, buf3, s87, stream=stream5) + del arg5_1 + buf4 = empty_strided_cuda((1, 1), (1, 1), torch.int64) + # Topologically Sorted Source Nodes: [flatten, max_1, add_2], Original ATen: [aten.view, aten.max, aten.add] + stream5 = get_raw_stream(5) + triton_poi_fused_add_max_view_3.run(buf4, s77, 1, stream=stream5) + return (reinterpret_tensor(buf2, (1, ), (1, ), 0), buf3, buf1, buf0, arg3_1, buf4, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = 1 + arg1_1 = rand_strided((1, 1), (1, 1), device='cuda:5', dtype=torch.float32) + arg2_1 = rand_strided((1, 1), (1, 1), device='cuda:5', dtype=torch.float32) + arg3_1 = rand_strided((1, 1), (1, 1), device='cuda:5', dtype=torch.int64) + arg4_1 = 6144 + arg5_1 = rand_strided((1, 6144), (6144, 1), device='cuda:5', dtype=torch.bfloat16) + arg6_1 = 1 + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/hj/chjplywvjqptohuj7scdxpy7eoho6x43um4wo56z7eleusgeo6kv.py b/.inductor_cache/hj/chjplywvjqptohuj7scdxpy7eoho6x43um4wo56z7eleusgeo6kv.py new file mode 100644 index 0000000000000000000000000000000000000000..89cfc5fd984577ec82297bd37ff46ec6cd1b25e3 --- /dev/null +++ b/.inductor_cache/hj/chjplywvjqptohuj7scdxpy7eoho6x43um4wo56z7eleusgeo6kv.py @@ -0,0 +1,27 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'out_ptr0': '*fp32', 'out_ptr1': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=4, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_max_mul_unsqueeze_view_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 2, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 192}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_max_mul_unsqueeze_view_0(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp2 = tmp0 * tmp1 + tl.store(out_ptr0 + (x0), tmp2, xmask) + tl.store(out_ptr1 + (x0), tmp2, xmask) diff --git a/.inductor_cache/hl/chlbfcu7q4max5g464e2h7zezgjnp2atszvlaasxnrdsgvhithrh.py b/.inductor_cache/hl/chlbfcu7q4max5g464e2h7zezgjnp2atszvlaasxnrdsgvhithrh.py new file mode 100644 index 0000000000000000000000000000000000000000..33cbb9fb896a893dfd5f0ebc70a1ba3f9e90fc3a --- /dev/null +++ b/.inductor_cache/hl/chlbfcu7q4max5g464e2h7zezgjnp2atszvlaasxnrdsgvhithrh.py @@ -0,0 +1,127 @@ +# AOT ID: ['9_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/ik/cikguuxtws4pk2zmdrqwvrpudf4mfsxc6mluq7tznfimjnzmkeys.py +# Topologically Sorted Source Nodes: [weights_1], Original ATen: [aten.mul] +# Source node to ATen node mapping: +# weights_1 => mul +# Graph fragment: +# %mm : Tensor "f32[1, 32][32, 1]cuda:2" = PlaceHolder[target=mm] +# %mul : Tensor "f32[1, 32][32, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mm, 0.1767766952966369), kwargs = {}) +# return %mul +triton_poi_fused_mul_0 = async_compile.triton('triton_poi_fused_mul_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 32}, + filename=__file__, + triton_meta={'signature': {'in_out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=2, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_0', 'mutated_arg_names': ['in_out_ptr0'], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 384}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_0(in_out_ptr0, xnumel, XBLOCK : tl.constexpr): + xnumel = 32 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_out_ptr0 + (x0), xmask) + tmp1 = tl.full([1], 0.1767766952966369, tl.float32) + tmp2 = tmp0 * tmp1 + tl.store(in_out_ptr0 + (x0), tmp2, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1 = args + args.clear() + assert_size_stride(arg0_1, (32, 6144), (6144, 1)) + assert_size_stride(arg1_1, (1, 6144), (6144, 1)) + with torch.cuda._DeviceGuard(2): + torch.cuda.set_device(2) + buf0 = empty_strided_cuda((1, 32), (32, 1), torch.float32) + # Topologically Sorted Source Nodes: [t, weights], Original ATen: [aten.t, aten.mm] + extern_kernels.mm_dtype(arg1_1, reinterpret_tensor(arg0_1, (6144, 32), (1, 6144), 0), out_dtype=torch.float32, out=buf0) + del arg0_1 + del arg1_1 + buf1 = buf0; del buf0 # reuse + # Topologically Sorted Source Nodes: [weights_1], Original ATen: [aten.mul] + stream2 = get_raw_stream(2) + triton_poi_fused_mul_0.run(buf1, 32, stream=stream2) + return (buf1, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = rand_strided((32, 6144), (6144, 1), device='cuda:2', dtype=torch.bfloat16) + arg1_1 = rand_strided((1, 6144), (6144, 1), device='cuda:2', dtype=torch.bfloat16) + return [arg0_1, arg1_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/hl/chlvcvvoyutm7cdyyrksbwfhb7gu6psnwijezzxcgw4hketvorhy.py b/.inductor_cache/hl/chlvcvvoyutm7cdyyrksbwfhb7gu6psnwijezzxcgw4hketvorhy.py new file mode 100644 index 0000000000000000000000000000000000000000..33b0c97a920cd7c4cc8684712fe16252ef790e1a --- /dev/null +++ b/.inductor_cache/hl/chlvcvvoyutm7cdyyrksbwfhb7gu6psnwijezzxcgw4hketvorhy.py @@ -0,0 +1,137 @@ +# AOT ID: ['10_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/x2/cx25zlfcmwa2tq3fmhvg3ipgdt4bwguxjdn25hqzbcatttltawyi.py +# Topologically Sorted Source Nodes: [unsqueeze, mul], Original ATen: [aten.unsqueeze, aten.mul] +# Source node to ATen node mapping: +# mul => mul_2 +# unsqueeze => unsqueeze +# Graph fragment: +# %arg1_1 : Tensor "f32[1, s3][s3, 1]cuda:0" = PlaceHolder[target=arg1_1] +# %arg2_1 : Tensor "f32[1, s3, 1][s3, 1, 1]cuda:0" = PlaceHolder[target=arg2_1] +# %arg3_1 : Tensor "f64[][]cpu" = PlaceHolder[target=arg3_1] +# %unsqueeze : Tensor "f32[1, s3, 1][s3, 1, 1]cuda:0"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%arg1_1, -1), kwargs = {}) +# %mul_2 : Tensor "f32[1, s3, 1][s3, 1, 1]cuda:0"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%unsqueeze, %arg2_1), kwargs = {}) +# %convert_element_type_default_1 : Tensor "f32[][]cpu"[num_users=1] = call_function[target=torch.ops.prims.convert_element_type.default](args = (%arg3_1, torch.float32), kwargs = {}) +# %mul_tensor : Tensor "f32[1, s3, 1][s3, 1, 1]cuda:0"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mul_2, %convert_element_type_default_1), kwargs = {}) +# return %mul_tensor +triton_poi_fused_mul_unsqueeze_0 = async_compile.triton('triton_poi_fused_mul_unsqueeze_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 32}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'in_ptr2': 'fp64', 'out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=0, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_unsqueeze_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 3, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 512}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_unsqueeze_0(in_ptr0, in_ptr1, in_ptr2, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp3 = in_ptr2 + tmp2 = tmp0 * tmp1 + tmp4 = tmp3.to(tl.float32) + tmp5 = tmp2 * tmp4 + tl.store(out_ptr0 + (x0), tmp5, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1 = args + args.clear() + s3 = arg0_1 + assert_size_stride(arg1_1, (1, s3), (s3, 1)) + assert_size_stride(arg2_1, (1, s3, 1), (s3, 1, 1)) + assert_size_stride(arg3_1, (), ()) + with torch.cuda._DeviceGuard(0): + torch.cuda.set_device(0) + buf0 = empty_strided_cuda((1, s3, 1), (s3, 1, 1), torch.float32) + # Topologically Sorted Source Nodes: [unsqueeze, mul], Original ATen: [aten.unsqueeze, aten.mul] + stream0 = get_raw_stream(0) + triton_poi_fused_mul_unsqueeze_0.run(arg1_1, arg2_1, arg3_1.item(), buf0, s3, stream=stream0) + del arg1_1 + del arg2_1 + del arg3_1 + return (buf0, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = 32 + arg1_1 = rand_strided((1, 32), (32, 1), device='cuda:0', dtype=torch.float32) + arg2_1 = rand_strided((1, 32, 1), (32, 1, 1), device='cuda:0', dtype=torch.float32) + arg3_1 = rand_strided((), (), device='cpu', dtype=torch.float64) + return [arg0_1, arg1_1, arg2_1, arg3_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/hq/96217eac87dc0151fe710da3735934415b22245cd030d057a44a54af9f05af7f.best_config b/.inductor_cache/hq/96217eac87dc0151fe710da3735934415b22245cd030d057a44a54af9f05af7f.best_config new file mode 100644 index 0000000000000000000000000000000000000000..15f7beb9cf14f338a13dd92e64b9e5f04e43bbd8 --- /dev/null +++ b/.inductor_cache/hq/96217eac87dc0151fe710da3735934415b22245cd030d057a44a54af9f05af7f.best_config @@ -0,0 +1 @@ +{"XBLOCK": 128, "num_warps": 4, "num_stages": 1, "configs_hash": "1b2cc4dbebb9680d3ce31843331593b159e4046c056f195ca1ccf2464d5b37d1", "found_by_coordesc": false, "time_taken_ms": 79, "triton_cache_hash": "LBOXSWDAX2GIZFOXRIZQ4S3246ZSKZAMDEVIL3FUHRGF3W6BJYLQ"} \ No newline at end of file diff --git a/.inductor_cache/hq/chq2yc37j736uphlh36y6ihrhpx4lv3n4jfqswgvzpbfdaqjm3nn.py b/.inductor_cache/hq/chq2yc37j736uphlh36y6ihrhpx4lv3n4jfqswgvzpbfdaqjm3nn.py new file mode 100644 index 0000000000000000000000000000000000000000..f16df226c0b6a34fc018e47b731c5078f1e9f076 --- /dev/null +++ b/.inductor_cache/hq/chq2yc37j736uphlh36y6ihrhpx4lv3n4jfqswgvzpbfdaqjm3nn.py @@ -0,0 +1,26 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 256}, + filename=__file__, + triton_meta={'signature': {'in_out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=5, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_0', 'mutated_arg_names': ['in_out_ptr0'], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 3072}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_0(in_out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_out_ptr0 + (x0), xmask) + tmp1 = tl.full([1], 0.1767766952966369, tl.float32) + tmp2 = tmp0 * tmp1 + tl.store(in_out_ptr0 + (x0), tmp2, xmask) diff --git a/.inductor_cache/hq/chqhkpqqc7ardyuwfanksuowqrkuu5ux5trfbf6fpidqyquo63tr.py b/.inductor_cache/hq/chqhkpqqc7ardyuwfanksuowqrkuu5ux5trfbf6fpidqyquo63tr.py new file mode 100644 index 0000000000000000000000000000000000000000..9bce7093f4077f6579a2a3f6a920dde8a29d6dda --- /dev/null +++ b/.inductor_cache/hq/chqhkpqqc7ardyuwfanksuowqrkuu5ux5trfbf6fpidqyquo63tr.py @@ -0,0 +1,45 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'ks0': 'i64', 'ks1': 'i64', 'ks2': 'i64', 'ks3': 'i64', 'ks4': 'i64', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=3, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_bitwise_and_bitwise_or_ge_lt_mul_sub_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_bitwise_and_bitwise_or_ge_lt_mul_sub_0(in_ptr0, out_ptr0, ks0, ks1, ks2, ks3, ks4, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = tl.load(in_ptr0 + (0)) + tmp1 = tl.broadcast_to(tmp0, [XBLOCK]) + tmp2 = ks0 + tmp3 = tmp1 >= tmp2 + tmp4 = ks1 + tmp5 = tmp1 < tmp4 + tmp6 = tmp3 & tmp5 + tmp7 = ks2 + tmp8 = tmp1 >= tmp7 + tmp9 = ks3 + tmp10 = tmp1 < tmp9 + tmp11 = tmp8 & tmp10 + tmp12 = tmp6 | tmp11 + tmp13 = tmp12.to(tl.int64) + tmp14 = tmp6.to(tl.int64) + tmp15 = tmp14 * tmp2 + tmp16 = tmp11.to(tl.int64) + tmp17 = ks0 + ks2 + ((-1)*ks1) + ((-1)*ks4) + tmp18 = tmp16 * tmp17 + tmp19 = tmp15 + tmp18 + tmp20 = tmp1 - tmp19 + tmp21 = tmp13 * tmp20 + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp21, None) diff --git a/.inductor_cache/ht/chtvevrrur2mhwksrflye5qrpzyzr3lhyiaedjqm62w5xqlm2qb2.py b/.inductor_cache/ht/chtvevrrur2mhwksrflye5qrpzyzr3lhyiaedjqm62w5xqlm2qb2.py new file mode 100644 index 0000000000000000000000000000000000000000..7eb3a6562c3bb64fd7d19bce0049673d1efc80a1 --- /dev/null +++ b/.inductor_cache/ht/chtvevrrur2mhwksrflye5qrpzyzr3lhyiaedjqm62w5xqlm2qb2.py @@ -0,0 +1,24 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'out_ptr0': '*i64', 'ks0': 'i64', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=0, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_max_view_3', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 0, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_max_view_3(out_ptr0, ks0, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = ks0 + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32)), tmp0, None) diff --git a/.inductor_cache/hu/chujwzp45m5yahhnr5syekcuiis6rtrwzqyrmq25euna5m4cxssa.py b/.inductor_cache/hu/chujwzp45m5yahhnr5syekcuiis6rtrwzqyrmq25euna5m4cxssa.py new file mode 100644 index 0000000000000000000000000000000000000000..8b39575803f4a01e0398542e85e7ce2f231db1f6 --- /dev/null +++ b/.inductor_cache/hu/chujwzp45m5yahhnr5syekcuiis6rtrwzqyrmq25euna5m4cxssa.py @@ -0,0 +1,46 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 128}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'out_ptr1': '*i1', 'ks0': 'i64', 'ks1': 'i64', 'ks2': 'i64', 'ks3': 'i64', 'ks4': 'i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=5, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_bitwise_and_bitwise_not_bitwise_or_ge_lt_mul_sub_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 2912}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_bitwise_and_bitwise_not_bitwise_or_ge_lt_mul_sub_0(in_ptr0, out_ptr0, out_ptr1, ks0, ks1, ks2, ks3, ks4, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = ks0 + tmp2 = tmp0 >= tmp1 + tmp3 = ks1 + tmp4 = tmp0 < tmp3 + tmp5 = tmp2 & tmp4 + tmp6 = ks2 + tmp7 = tmp0 >= tmp6 + tmp8 = ks3 + tmp9 = tmp0 < tmp8 + tmp10 = tmp7 & tmp9 + tmp11 = tmp5 | tmp10 + tmp12 = tmp11.to(tl.int64) + tmp13 = tmp5.to(tl.int64) + tmp14 = tmp13 * tmp1 + tmp15 = tmp10.to(tl.int64) + tmp16 = ks0 + ks2 + ((-1)*ks1) + ((-1)*ks4) + tmp17 = tmp15 * tmp16 + tmp18 = tmp14 + tmp17 + tmp19 = tmp0 - tmp18 + tmp20 = tmp12 * tmp19 + tmp21 = tmp11 == 0 + tl.store(out_ptr0 + (x0), tmp20, xmask) + tl.store(out_ptr1 + (x0), tmp21, xmask) diff --git a/.inductor_cache/hu/chumfn5dnh4divjblvadp4di35whjhi2ilih3kiyaam7agvrg2hf.py b/.inductor_cache/hu/chumfn5dnh4divjblvadp4di35whjhi2ilih3kiyaam7agvrg2hf.py new file mode 100644 index 0000000000000000000000000000000000000000..fa52dee0e3a45d643d9634e555188d5180115515 --- /dev/null +++ b/.inductor_cache/hu/chumfn5dnh4divjblvadp4di35whjhi2ilih3kiyaam7agvrg2hf.py @@ -0,0 +1,24 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 2}, + filename=__file__, + triton_meta={'signature': {'out_ptr0': '*i64', 'ks0': 'i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=1, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_max_view_3', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 0, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 8}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_max_view_3(out_ptr0, ks0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = ks0 + tl.store(out_ptr0 + (x0), tmp0, xmask) diff --git a/.inductor_cache/hv/chvfd2srpyzm22iazgkmvauaaogx56fk5g7gebeqlut3qipf64xe.py b/.inductor_cache/hv/chvfd2srpyzm22iazgkmvauaaogx56fk5g7gebeqlut3qipf64xe.py new file mode 100644 index 0000000000000000000000000000000000000000..1408d9466ad261496e0e0a17612ffe0f8e5e73d8 --- /dev/null +++ b/.inductor_cache/hv/chvfd2srpyzm22iazgkmvauaaogx56fk5g7gebeqlut3qipf64xe.py @@ -0,0 +1,293 @@ +# AOT ID: ['13_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/6r/c6rthxci3676wj2mwj62e5zmpmln5m2yrpnp2cb63gsxh4u2zxhz.py +# Topologically Sorted Source Nodes: [unsqueeze, view, expand_scores, flatten, max_1], Original ATen: [aten.unsqueeze, aten.view, aten.mul, aten.max] +# Source node to ATen node mapping: +# expand_scores => mul_3 +# flatten => view_1 +# max_1 => getitem, max_1 +# unsqueeze => unsqueeze +# view => view +# Graph fragment: +# %arg2_1 : Tensor "f32[s0, 1][1, 1]cuda:4" = PlaceHolder[target=arg2_1] +# %arg4_1 : Tensor "f32[s0, 1][1, 1]cuda:4" = PlaceHolder[target=arg4_1] +# %mul_3 : Tensor "f32[s0, 1, 1][1, 1, 1]cuda:4" = PlaceHolder[target=mul_3] +# %unsqueeze : Tensor "f32[s0, 1, 1][1, 1, 1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%arg2_1, 2), kwargs = {}) +# %view : Tensor "f32[s0, 1, 1][1, 1, 1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%arg4_1, [-1, 1, 1]), kwargs = {}) +# %mul_3 : Tensor "f32[s0, 1, 1][1, 1, 1]cuda:4"[num_users=2] = call_function[target=torch.ops.aten.mul.Tensor](args = (%unsqueeze, %view), kwargs = {}) +# %view_1 : Tensor "f32[s0, 1][1, 1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg3_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %getitem : Tensor "f32[s0, 1][1, 1]cuda:4"[num_users=1] = call_function[target=operator.getitem](args = (%max_1, 0), kwargs = {}) +# return %mul_3,%getitem +triton_poi_fused_max_mul_unsqueeze_view_0 = async_compile.triton('triton_poi_fused_max_mul_unsqueeze_view_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 2}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'out_ptr0': '*fp32', 'out_ptr1': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=4, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_max_mul_unsqueeze_view_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 2, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 12}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_max_mul_unsqueeze_view_0(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp2 = tmp0 * tmp1 + tl.store(out_ptr0 + (x0), tmp2, xmask) + tl.store(out_ptr1 + (x0), tmp2, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/vg/cvgci5k63gha5jorgnftge6uzqnuqxhzle6ijrzbqovefvmeaacy.py +# Topologically Sorted Source Nodes: [flatten, max_1, gather], Original ATen: [aten.view, aten.max, aten.gather] +# Source node to ATen node mapping: +# flatten => view_1 +# gather => gather +# max_1 => max_1 +# Graph fragment: +# %arg6_1 : Tensor "i64[s37, 1][1, 1]cuda:4" = PlaceHolder[target=arg6_1] +# %view_1 : Tensor "f32[s0, 1][1, 1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg3_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %gather : Tensor "i64[s0, 1][1, 1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.gather.default](args = (%arg6_1, 1, %getitem_1), kwargs = {}) +# return %gather +triton_poi_fused_gather_max_view_1 = async_compile.triton('triton_poi_fused_gather_max_view_1', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 2}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=4, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_gather_max_view_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 12}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_gather_max_view_1(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tl.store(out_ptr0 + (x0), tmp0, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/ph/cphsftnfvqgyx6phk6pz33guvbz3xqjost5uerkyepgej7sakgm7.py +# Topologically Sorted Source Nodes: [flatten, max_1, flat_cs, floordiv, batch_offsets, repeat_interleave, selected_input_index, hidden_states], Original ATen: [aten.view, aten.max, aten.floor_divide, aten.arange, aten.unsqueeze, aten.add, aten.index] +# Source node to ATen node mapping: +# batch_offsets => iota +# flat_cs => view_4 +# flatten => view_1 +# floordiv => div +# hidden_states => index +# max_1 => max_1 +# repeat_interleave => unsqueeze_1, view_5 +# selected_input_index => add_47 +# Graph fragment: +# %arg8_1 : Tensor "bf16[s0, s87][s87, 1]cuda:4" = PlaceHolder[target=arg8_1] +# %view_1 : Tensor "f32[s0, 1][1, 1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg3_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %view_4 : Tensor "i64[s0][1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%getitem_1, [%arg3_1]), kwargs = {}) +# %div : Tensor "i64[s0][1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.div.Tensor_mode](args = (%view_4, 1), kwargs = {rounding_mode: floor}) +# %iota : Tensor "i64[s0][1]cuda:4"[num_users=1] = call_function[target=torch.ops.prims.iota.default](args = (%arg3_1,), kwargs = {start: 0, step: 1, dtype: torch.int64, device: cuda:4, requires_grad: False}) +# %unsqueeze_1 : Tensor "i64[s0, 1][1, 1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%iota, 1), kwargs = {}) +# %view_5 : Tensor "i64[s0][1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%expand, [%arg3_1]), kwargs = {}) +# %add_47 : Tensor "i64[s0][1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%div, %view_5), kwargs = {}) +# %index : Tensor "bf16[s0, s87][s87, 1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.index.Tensor](args = (%arg8_1, [%add_47]), kwargs = {}) +# return %index +triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2 = async_compile.triton('triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 16384}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*bf16', 'out_ptr0': '*bf16', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=4, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 73728}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x2 = xindex + tmp0 = tl.load(in_ptr0 + (x2), xmask, eviction_policy='evict_last').to(tl.float32) + tl.store(out_ptr0 + (x2), tmp0, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/d7/cd7kv3fd3rbwl5z3lzl4d65tpfg5ewegaj7vncqz7to737vwyhfc.py +# Topologically Sorted Source Nodes: [flatten, max_1, add_2], Original ATen: [aten.view, aten.max, aten.add] +# Source node to ATen node mapping: +# add_2 => add_53 +# flatten => view_1 +# max_1 => max_1 +# Graph fragment: +# %view_1 : Tensor "f32[s0, 1][1, 1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg3_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %add_53 : Tensor "i64[s0, 1][1, 1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%getitem_1, %arg9_1), kwargs = {}) +# return %add_53 +triton_poi_fused_add_max_view_3 = async_compile.triton('triton_poi_fused_add_max_view_3', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 2}, + filename=__file__, + triton_meta={'signature': {'out_ptr0': '*i64', 'ks0': 'i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=4, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_max_view_3', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 0, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 8}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_max_view_3(out_ptr0, ks0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = ks0 + tl.store(out_ptr0 + (x0), tmp0, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1, arg7_1, arg8_1, arg9_1 = args + args.clear() + s53 = arg0_1 + s68 = arg1_1 + s0 = arg3_1 + s37 = arg5_1 + s87 = arg7_1 + s77 = arg9_1 + assert_size_stride(arg2_1, (s0, 1), (1, 1)) + assert_size_stride(arg4_1, (s0, 1), (1, 1)) + assert_size_stride(arg6_1, (s37, 1), (1, 1)) + assert_size_stride(arg8_1, (s0, s87), (s87, 1)) + with torch.cuda._DeviceGuard(4): + torch.cuda.set_device(4) + buf0 = empty_strided_cuda((s0, 1, 1), (1, 1, 1), torch.float32) + buf1 = empty_strided_cuda((s0, 1), (1, 1), torch.float32) + # Topologically Sorted Source Nodes: [unsqueeze, view, expand_scores, flatten, max_1], Original ATen: [aten.unsqueeze, aten.view, aten.mul, aten.max] + stream4 = get_raw_stream(4) + triton_poi_fused_max_mul_unsqueeze_view_0.run(arg2_1, arg4_1, buf0, buf1, s0, stream=stream4) + del arg2_1 + del arg4_1 + buf2 = empty_strided_cuda((s0, 1), (1, 1), torch.int64) + # Topologically Sorted Source Nodes: [flatten, max_1, gather], Original ATen: [aten.view, aten.max, aten.gather] + stream4 = get_raw_stream(4) + triton_poi_fused_gather_max_view_1.run(arg6_1, buf2, s0, stream=stream4) + buf3 = empty_strided_cuda((s0, s87), (s87, 1), torch.bfloat16) + # Topologically Sorted Source Nodes: [flatten, max_1, flat_cs, floordiv, batch_offsets, repeat_interleave, selected_input_index, hidden_states], Original ATen: [aten.view, aten.max, aten.floor_divide, aten.arange, aten.unsqueeze, aten.add, aten.index] + triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2_xnumel = s0*s87 + stream4 = get_raw_stream(4) + triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2.run(arg8_1, buf3, triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2_xnumel, stream=stream4) + del arg8_1 + buf4 = empty_strided_cuda((s0, 1), (1, 1), torch.int64) + # Topologically Sorted Source Nodes: [flatten, max_1, add_2], Original ATen: [aten.view, aten.max, aten.add] + stream4 = get_raw_stream(4) + triton_poi_fused_add_max_view_3.run(buf4, s77, s0, stream=stream4) + return (reinterpret_tensor(buf2, (s0, ), (1, ), 0), buf3, buf1, buf0, arg6_1, buf4, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = 1 + arg1_1 = 2 + arg2_1 = rand_strided((2, 1), (1, 1), device='cuda:4', dtype=torch.float32) + arg3_1 = 2 + arg4_1 = rand_strided((2, 1), (1, 1), device='cuda:4', dtype=torch.float32) + arg5_1 = 2 + arg6_1 = rand_strided((2, 1), (1, 1), device='cuda:4', dtype=torch.int64) + arg7_1 = 6144 + arg8_1 = rand_strided((2, 6144), (6144, 1), device='cuda:4', dtype=torch.bfloat16) + arg9_1 = 1 + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1, arg7_1, arg8_1, arg9_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/i2/ci252r34c4yo7p3rn2gomwr2yopckzpblszb4potci4h46c3vpof.py b/.inductor_cache/i2/ci252r34c4yo7p3rn2gomwr2yopckzpblszb4potci4h46c3vpof.py new file mode 100644 index 0000000000000000000000000000000000000000..b7b1b0f6b82a572f298aaf78b3107580eaf9bdc5 --- /dev/null +++ b/.inductor_cache/i2/ci252r34c4yo7p3rn2gomwr2yopckzpblszb4potci4h46c3vpof.py @@ -0,0 +1,29 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'out_ptr0': '*fp32', 'out_ptr1': '*fp32', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=2, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_max_mul_unsqueeze_view_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 2, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_max_mul_unsqueeze_view_0(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = tl.load(in_ptr0 + (0)) + tmp1 = tl.broadcast_to(tmp0, [XBLOCK]) + tmp2 = tl.load(in_ptr1 + (0)) + tmp3 = tl.broadcast_to(tmp2, [XBLOCK]) + tmp4 = tmp1 * tmp3 + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp4, None) + tl.store(out_ptr1 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp4, None) diff --git a/.inductor_cache/i4/ci44nfvisoh3xy7gdjxb4q7xxaytj5j4gs5o3m7nhvoj7djvx2di.py b/.inductor_cache/i4/ci44nfvisoh3xy7gdjxb4q7xxaytj5j4gs5o3m7nhvoj7djvx2di.py new file mode 100644 index 0000000000000000000000000000000000000000..0245a5b27abc53a28f988d604b2e6ee1ce30e7ed --- /dev/null +++ b/.inductor_cache/i4/ci44nfvisoh3xy7gdjxb4q7xxaytj5j4gs5o3m7nhvoj7djvx2di.py @@ -0,0 +1,127 @@ +# AOT ID: ['9_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/vo/cvol7z4dlk2uu5fqdzqfzt7zomahpzqjvbsha35q4gyykibo34n7.py +# Topologically Sorted Source Nodes: [weights_1], Original ATen: [aten.mul] +# Source node to ATen node mapping: +# weights_1 => mul +# Graph fragment: +# %mm : Tensor "f32[1, 32][32, 1]cuda:0" = PlaceHolder[target=mm] +# %mul : Tensor "f32[1, 32][32, 1]cuda:0"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mm, 0.1767766952966369), kwargs = {}) +# return %mul +triton_poi_fused_mul_0 = async_compile.triton('triton_poi_fused_mul_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 32}, + filename=__file__, + triton_meta={'signature': {'in_out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=0, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_0', 'mutated_arg_names': ['in_out_ptr0'], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 384}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_0(in_out_ptr0, xnumel, XBLOCK : tl.constexpr): + xnumel = 32 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_out_ptr0 + (x0), xmask) + tmp1 = tl.full([1], 0.1767766952966369, tl.float32) + tmp2 = tmp0 * tmp1 + tl.store(in_out_ptr0 + (x0), tmp2, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1 = args + args.clear() + assert_size_stride(arg0_1, (32, 6144), (6144, 1)) + assert_size_stride(arg1_1, (1, 6144), (6144, 1)) + with torch.cuda._DeviceGuard(0): + torch.cuda.set_device(0) + buf0 = empty_strided_cuda((1, 32), (32, 1), torch.float32) + # Topologically Sorted Source Nodes: [t, weights], Original ATen: [aten.t, aten.mm] + extern_kernels.mm_dtype(arg1_1, reinterpret_tensor(arg0_1, (6144, 32), (1, 6144), 0), out_dtype=torch.float32, out=buf0) + del arg0_1 + del arg1_1 + buf1 = buf0; del buf0 # reuse + # Topologically Sorted Source Nodes: [weights_1], Original ATen: [aten.mul] + stream0 = get_raw_stream(0) + triton_poi_fused_mul_0.run(buf1, 32, stream=stream0) + return (buf1, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = rand_strided((32, 6144), (6144, 1), device='cuda:0', dtype=torch.bfloat16) + arg1_1 = rand_strided((1, 6144), (6144, 1), device='cuda:0', dtype=torch.bfloat16) + return [arg0_1, arg1_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/ik/cikguuxtws4pk2zmdrqwvrpudf4mfsxc6mluq7tznfimjnzmkeys.py b/.inductor_cache/ik/cikguuxtws4pk2zmdrqwvrpudf4mfsxc6mluq7tznfimjnzmkeys.py new file mode 100644 index 0000000000000000000000000000000000000000..58426a4ca03739eb23e88fd1f8ecef66a8dae71a --- /dev/null +++ b/.inductor_cache/ik/cikguuxtws4pk2zmdrqwvrpudf4mfsxc6mluq7tznfimjnzmkeys.py @@ -0,0 +1,27 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 32}, + filename=__file__, + triton_meta={'signature': {'in_out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=2, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_0', 'mutated_arg_names': ['in_out_ptr0'], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 384}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_0(in_out_ptr0, xnumel, XBLOCK : tl.constexpr): + xnumel = 32 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_out_ptr0 + (x0), xmask) + tmp1 = tl.full([1], 0.1767766952966369, tl.float32) + tmp2 = tmp0 * tmp1 + tl.store(in_out_ptr0 + (x0), tmp2, xmask) diff --git a/.inductor_cache/ik/cikku2fpk2b4s6vuk2hty674kmro7ddkwhudvfmtmep5jlqdgcdd.py b/.inductor_cache/ik/cikku2fpk2b4s6vuk2hty674kmro7ddkwhudvfmtmep5jlqdgcdd.py new file mode 100644 index 0000000000000000000000000000000000000000..c0b9d2b9bb213ccca963036a710286101e3454f0 --- /dev/null +++ b/.inductor_cache/ik/cikku2fpk2b4s6vuk2hty674kmro7ddkwhudvfmtmep5jlqdgcdd.py @@ -0,0 +1,293 @@ +# AOT ID: ['13_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/c2/cc25fewy4m4iyagkjflqeky33l6wn3onp7fgvcukt55mhimrmasg.py +# Topologically Sorted Source Nodes: [unsqueeze, view, expand_scores, flatten, max_1], Original ATen: [aten.unsqueeze, aten.view, aten.mul, aten.max] +# Source node to ATen node mapping: +# expand_scores => mul_3 +# flatten => view_1 +# max_1 => getitem, max_1 +# unsqueeze => unsqueeze +# view => view +# Graph fragment: +# %arg2_1 : Tensor "f32[s0, 1][1, 1]cuda:7" = PlaceHolder[target=arg2_1] +# %arg4_1 : Tensor "f32[s0, 1][1, 1]cuda:7" = PlaceHolder[target=arg4_1] +# %mul_3 : Tensor "f32[s0, 1, 1][1, 1, 1]cuda:7" = PlaceHolder[target=mul_3] +# %unsqueeze : Tensor "f32[s0, 1, 1][1, 1, 1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%arg2_1, 2), kwargs = {}) +# %view : Tensor "f32[s0, 1, 1][1, 1, 1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%arg4_1, [-1, 1, 1]), kwargs = {}) +# %mul_3 : Tensor "f32[s0, 1, 1][1, 1, 1]cuda:7"[num_users=2] = call_function[target=torch.ops.aten.mul.Tensor](args = (%unsqueeze, %view), kwargs = {}) +# %view_1 : Tensor "f32[s0, 1][1, 1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg3_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %getitem : Tensor "f32[s0, 1][1, 1]cuda:7"[num_users=1] = call_function[target=operator.getitem](args = (%max_1, 0), kwargs = {}) +# return %mul_3,%getitem +triton_poi_fused_max_mul_unsqueeze_view_0 = async_compile.triton('triton_poi_fused_max_mul_unsqueeze_view_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 2}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'out_ptr0': '*fp32', 'out_ptr1': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=7, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_max_mul_unsqueeze_view_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 2, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 12}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_max_mul_unsqueeze_view_0(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp2 = tmp0 * tmp1 + tl.store(out_ptr0 + (x0), tmp2, xmask) + tl.store(out_ptr1 + (x0), tmp2, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/bq/cbqrbuxfav76d45dukkxmnz6za4zr4kddcvpodgbq4lzgiotjhag.py +# Topologically Sorted Source Nodes: [flatten, max_1, gather], Original ATen: [aten.view, aten.max, aten.gather] +# Source node to ATen node mapping: +# flatten => view_1 +# gather => gather +# max_1 => max_1 +# Graph fragment: +# %arg6_1 : Tensor "i64[s37, 1][1, 1]cuda:7" = PlaceHolder[target=arg6_1] +# %view_1 : Tensor "f32[s0, 1][1, 1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg3_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %gather : Tensor "i64[s0, 1][1, 1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.gather.default](args = (%arg6_1, 1, %getitem_1), kwargs = {}) +# return %gather +triton_poi_fused_gather_max_view_1 = async_compile.triton('triton_poi_fused_gather_max_view_1', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 2}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=7, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_gather_max_view_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 12}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_gather_max_view_1(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tl.store(out_ptr0 + (x0), tmp0, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/er/cer3iwnrt32abye3ztneej3z43wqnxplsgqgt3mqozdpnnckxmys.py +# Topologically Sorted Source Nodes: [flatten, max_1, flat_cs, floordiv, batch_offsets, repeat_interleave, selected_input_index, hidden_states], Original ATen: [aten.view, aten.max, aten.floor_divide, aten.arange, aten.unsqueeze, aten.add, aten.index] +# Source node to ATen node mapping: +# batch_offsets => iota +# flat_cs => view_4 +# flatten => view_1 +# floordiv => div +# hidden_states => index +# max_1 => max_1 +# repeat_interleave => unsqueeze_1, view_5 +# selected_input_index => add_47 +# Graph fragment: +# %arg8_1 : Tensor "bf16[s0, s87][s87, 1]cuda:7" = PlaceHolder[target=arg8_1] +# %view_1 : Tensor "f32[s0, 1][1, 1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg3_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %view_4 : Tensor "i64[s0][1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%getitem_1, [%arg3_1]), kwargs = {}) +# %div : Tensor "i64[s0][1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.div.Tensor_mode](args = (%view_4, 1), kwargs = {rounding_mode: floor}) +# %iota : Tensor "i64[s0][1]cuda:7"[num_users=1] = call_function[target=torch.ops.prims.iota.default](args = (%arg3_1,), kwargs = {start: 0, step: 1, dtype: torch.int64, device: cuda:7, requires_grad: False}) +# %unsqueeze_1 : Tensor "i64[s0, 1][1, 1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%iota, 1), kwargs = {}) +# %view_5 : Tensor "i64[s0][1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%expand, [%arg3_1]), kwargs = {}) +# %add_47 : Tensor "i64[s0][1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%div, %view_5), kwargs = {}) +# %index : Tensor "bf16[s0, s87][s87, 1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.index.Tensor](args = (%arg8_1, [%add_47]), kwargs = {}) +# return %index +triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2 = async_compile.triton('triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 16384}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*bf16', 'out_ptr0': '*bf16', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=7, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 73728}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x2 = xindex + tmp0 = tl.load(in_ptr0 + (x2), xmask, eviction_policy='evict_last').to(tl.float32) + tl.store(out_ptr0 + (x2), tmp0, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/5s/c5s4bm2q3gua3tgmxnj3denzqvuhpgrb5kx5rjwxxb4isc7lmqaz.py +# Topologically Sorted Source Nodes: [flatten, max_1, add_2], Original ATen: [aten.view, aten.max, aten.add] +# Source node to ATen node mapping: +# add_2 => add_53 +# flatten => view_1 +# max_1 => max_1 +# Graph fragment: +# %view_1 : Tensor "f32[s0, 1][1, 1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg3_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %add_53 : Tensor "i64[s0, 1][1, 1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%getitem_1, %arg9_1), kwargs = {}) +# return %add_53 +triton_poi_fused_add_max_view_3 = async_compile.triton('triton_poi_fused_add_max_view_3', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 2}, + filename=__file__, + triton_meta={'signature': {'out_ptr0': '*i64', 'ks0': 'i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=7, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_max_view_3', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 0, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 8}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_max_view_3(out_ptr0, ks0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = ks0 + tl.store(out_ptr0 + (x0), tmp0, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1, arg7_1, arg8_1, arg9_1 = args + args.clear() + s53 = arg0_1 + s68 = arg1_1 + s0 = arg3_1 + s37 = arg5_1 + s87 = arg7_1 + s77 = arg9_1 + assert_size_stride(arg2_1, (s0, 1), (1, 1)) + assert_size_stride(arg4_1, (s0, 1), (1, 1)) + assert_size_stride(arg6_1, (s37, 1), (1, 1)) + assert_size_stride(arg8_1, (s0, s87), (s87, 1)) + with torch.cuda._DeviceGuard(7): + torch.cuda.set_device(7) + buf0 = empty_strided_cuda((s0, 1, 1), (1, 1, 1), torch.float32) + buf1 = empty_strided_cuda((s0, 1), (1, 1), torch.float32) + # Topologically Sorted Source Nodes: [unsqueeze, view, expand_scores, flatten, max_1], Original ATen: [aten.unsqueeze, aten.view, aten.mul, aten.max] + stream7 = get_raw_stream(7) + triton_poi_fused_max_mul_unsqueeze_view_0.run(arg2_1, arg4_1, buf0, buf1, s0, stream=stream7) + del arg2_1 + del arg4_1 + buf2 = empty_strided_cuda((s0, 1), (1, 1), torch.int64) + # Topologically Sorted Source Nodes: [flatten, max_1, gather], Original ATen: [aten.view, aten.max, aten.gather] + stream7 = get_raw_stream(7) + triton_poi_fused_gather_max_view_1.run(arg6_1, buf2, s0, stream=stream7) + buf3 = empty_strided_cuda((s0, s87), (s87, 1), torch.bfloat16) + # Topologically Sorted Source Nodes: [flatten, max_1, flat_cs, floordiv, batch_offsets, repeat_interleave, selected_input_index, hidden_states], Original ATen: [aten.view, aten.max, aten.floor_divide, aten.arange, aten.unsqueeze, aten.add, aten.index] + triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2_xnumel = s0*s87 + stream7 = get_raw_stream(7) + triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2.run(arg8_1, buf3, triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2_xnumel, stream=stream7) + del arg8_1 + buf4 = empty_strided_cuda((s0, 1), (1, 1), torch.int64) + # Topologically Sorted Source Nodes: [flatten, max_1, add_2], Original ATen: [aten.view, aten.max, aten.add] + stream7 = get_raw_stream(7) + triton_poi_fused_add_max_view_3.run(buf4, s77, s0, stream=stream7) + return (reinterpret_tensor(buf2, (s0, ), (1, ), 0), buf3, buf1, buf0, arg6_1, buf4, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = 1 + arg1_1 = 2 + arg2_1 = rand_strided((2, 1), (1, 1), device='cuda:7', dtype=torch.float32) + arg3_1 = 2 + arg4_1 = rand_strided((2, 1), (1, 1), device='cuda:7', dtype=torch.float32) + arg5_1 = 2 + arg6_1 = rand_strided((2, 1), (1, 1), device='cuda:7', dtype=torch.int64) + arg7_1 = 6144 + arg8_1 = rand_strided((2, 6144), (6144, 1), device='cuda:7', dtype=torch.bfloat16) + arg9_1 = 1 + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1, arg7_1, arg8_1, arg9_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/il/cilix5232qonfq36nk7fxtgexztiywxeddqcaf4s6ibka6ieczbw.py b/.inductor_cache/il/cilix5232qonfq36nk7fxtgexztiywxeddqcaf4s6ibka6ieczbw.py new file mode 100644 index 0000000000000000000000000000000000000000..cf35d18f808b00ee31a421d21ec3ceac093d7c5b --- /dev/null +++ b/.inductor_cache/il/cilix5232qonfq36nk7fxtgexztiywxeddqcaf4s6ibka6ieczbw.py @@ -0,0 +1,148 @@ +# AOT ID: ['1_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/bm/cbm42ze4ug2fdwztejjykx3hr6afph6fl33kksrldc6xarefqiy7.py +# Topologically Sorted Source Nodes: [weights_1, unsqueeze, mul_1], Original ATen: [aten.mul, aten.unsqueeze] +# Source node to ATen node mapping: +# mul_1 => mul_7 +# unsqueeze => unsqueeze +# weights_1 => mul_2 +# Graph fragment: +# %mm : Tensor "f32[s77, 32][32, 1]cuda:1" = PlaceHolder[target=mm] +# %arg3_1 : Tensor "f32[s77, 32, 1][32, 1, 1]cuda:1" = PlaceHolder[target=arg3_1] +# %arg4_1 : Tensor "f64[][]cpu" = PlaceHolder[target=arg4_1] +# %mul_2 : Tensor "f32[s77, 32][32, 1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mm, 0.1767766952966369), kwargs = {}) +# %unsqueeze : Tensor "f32[s77, 32, 1][32, 1, 1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%mul_2, -1), kwargs = {}) +# %mul_7 : Tensor "f32[s77, 32, 1][32, 1, 1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%unsqueeze, %arg3_1), kwargs = {}) +# %convert_element_type_default_1 : Tensor "f32[][]cpu"[num_users=1] = call_function[target=torch.ops.prims.convert_element_type.default](args = (%arg4_1, torch.float32), kwargs = {}) +# %mul_tensor : Tensor "f32[s77, 32, 1][32, 1, 1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mul_7, %convert_element_type_default_1), kwargs = {}) +# return %mul_tensor +triton_poi_fused_mul_unsqueeze_0 = async_compile.triton('triton_poi_fused_mul_unsqueeze_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 4096}, + filename=__file__, + triton_meta={'signature': {'in_out_ptr0': '*fp32', 'in_ptr0': '*fp32', 'in_ptr1': 'fp64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=1, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_unsqueeze_0', 'mutated_arg_names': ['in_out_ptr0'], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 3, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 57344}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_unsqueeze_0(in_out_ptr0, in_ptr0, in_ptr1, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_out_ptr0 + (x0), xmask) + tmp3 = tl.load(in_ptr0 + (x0), xmask) + tmp5 = in_ptr1 + tmp1 = tl.full([1], 0.1767766952966369, tl.float32) + tmp2 = tmp0 * tmp1 + tmp4 = tmp2 * tmp3 + tmp6 = tmp5.to(tl.float32) + tmp7 = tmp4 * tmp6 + tl.store(in_out_ptr0 + (x0), tmp7, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1 = args + args.clear() + s77 = arg1_1 + assert_size_stride(arg0_1, (32, 6144), (6144, 1)) + assert_size_stride(arg2_1, (s77, 6144), (6144, 1)) + assert_size_stride(arg3_1, (s77, 32, 1), (32, 1, 1)) + assert_size_stride(arg4_1, (), ()) + with torch.cuda._DeviceGuard(1): + torch.cuda.set_device(1) + buf0 = empty_strided_cuda((s77, 32), (32, 1), torch.float32) + # Topologically Sorted Source Nodes: [t, weights], Original ATen: [aten.t, aten.mm] + extern_kernels.mm_dtype(arg2_1, reinterpret_tensor(arg0_1, (6144, 32), (1, 6144), 0), out_dtype=torch.float32, out=buf0) + del arg0_1 + del arg2_1 + buf1 = reinterpret_tensor(buf0, (s77, 32, 1), (32, 1, 1), 0); del buf0 # reuse + # Topologically Sorted Source Nodes: [weights_1, unsqueeze, mul_1], Original ATen: [aten.mul, aten.unsqueeze] + triton_poi_fused_mul_unsqueeze_0_xnumel = 32*s77 + stream1 = get_raw_stream(1) + triton_poi_fused_mul_unsqueeze_0.run(buf1, arg3_1, arg4_1.item(), triton_poi_fused_mul_unsqueeze_0_xnumel, stream=stream1) + del arg3_1 + del arg4_1 + return (buf1, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = rand_strided((32, 6144), (6144, 1), device='cuda:1', dtype=torch.bfloat16) + arg1_1 = 112 + arg2_1 = rand_strided((112, 6144), (6144, 1), device='cuda:1', dtype=torch.bfloat16) + arg3_1 = rand_strided((112, 32, 1), (32, 1, 1), device='cuda:1', dtype=torch.float32) + arg4_1 = rand_strided((), (), device='cpu', dtype=torch.float64) + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/in/cinym3hv7fv6jpjbbmmapeljldm7umzd5htvihr3dlt7qh5h5e5p.py b/.inductor_cache/in/cinym3hv7fv6jpjbbmmapeljldm7umzd5htvihr3dlt7qh5h5e5p.py new file mode 100644 index 0000000000000000000000000000000000000000..53de2a28187bfbcf12585a1d41636c3fa379944c --- /dev/null +++ b/.inductor_cache/in/cinym3hv7fv6jpjbbmmapeljldm7umzd5htvihr3dlt7qh5h5e5p.py @@ -0,0 +1,27 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 2}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'out_ptr0': '*fp32', 'out_ptr1': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=2, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_max_mul_unsqueeze_view_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 2, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 12}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_max_mul_unsqueeze_view_0(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp2 = tmp0 * tmp1 + tl.store(out_ptr0 + (x0), tmp2, xmask) + tl.store(out_ptr1 + (x0), tmp2, xmask) diff --git a/.inductor_cache/io/ciopxhsx6vkum5sp4j2ja5xf7tlx3akuivwd444wcldaryb5abhw.py b/.inductor_cache/io/ciopxhsx6vkum5sp4j2ja5xf7tlx3akuivwd444wcldaryb5abhw.py new file mode 100644 index 0000000000000000000000000000000000000000..086b78c09da1f1839b65ba5fc59e862b3fe74d52 --- /dev/null +++ b/.inductor_cache/io/ciopxhsx6vkum5sp4j2ja5xf7tlx3akuivwd444wcldaryb5abhw.py @@ -0,0 +1,29 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'out_ptr0': '*fp32', 'out_ptr1': '*fp32', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=7, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_max_mul_unsqueeze_view_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 2, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_max_mul_unsqueeze_view_0(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = tl.load(in_ptr0 + (0)) + tmp1 = tl.broadcast_to(tmp0, [XBLOCK]) + tmp2 = tl.load(in_ptr1 + (0)) + tmp3 = tl.broadcast_to(tmp2, [XBLOCK]) + tmp4 = tmp1 * tmp3 + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp4, None) + tl.store(out_ptr1 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp4, None) diff --git a/.inductor_cache/ip/cip7shjzl265qangyfkcqywpgdfirprtfxy2iinccuesz2bnb2y7.py b/.inductor_cache/ip/cip7shjzl265qangyfkcqywpgdfirprtfxy2iinccuesz2bnb2y7.py new file mode 100644 index 0000000000000000000000000000000000000000..985de6f315f4586754c9671108542b44d3cd6385 --- /dev/null +++ b/.inductor_cache/ip/cip7shjzl265qangyfkcqywpgdfirprtfxy2iinccuesz2bnb2y7.py @@ -0,0 +1,142 @@ +# AOT ID: ['5_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/2k/c2kidoyobarbdwts46exm2wpdobdyvsxybtugfjxnxbjmacldvms.py +# Topologically Sorted Source Nodes: [unsqueeze, mul], Original ATen: [aten.unsqueeze, aten.mul] +# Source node to ATen node mapping: +# mul => mul_2 +# unsqueeze => unsqueeze +# Graph fragment: +# %arg2_1 : Tensor "f32[s0, s3][s3, 1]cuda:2" = PlaceHolder[target=arg2_1] +# %arg3_1 : Tensor "f32[s0, s3, 1][s3, 1, 1]cuda:2" = PlaceHolder[target=arg3_1] +# %arg4_1 : Tensor "f64[][]cpu" = PlaceHolder[target=arg4_1] +# %unsqueeze : Tensor "f32[s0, s3, 1][s3, 1, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%arg2_1, -1), kwargs = {}) +# %mul_2 : Tensor "f32[s0, s3, 1][s3, 1, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%unsqueeze, %arg3_1), kwargs = {}) +# %convert_element_type_default_1 : Tensor "f32[][]cpu"[num_users=1] = call_function[target=torch.ops.prims.convert_element_type.default](args = (%arg4_1, torch.float32), kwargs = {}) +# %mul_tensor : Tensor "f32[s0, s3, 1][s3, 1, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mul_2, %convert_element_type_default_1), kwargs = {}) +# return %mul_tensor +triton_poi_fused_mul_unsqueeze_0 = async_compile.triton('triton_poi_fused_mul_unsqueeze_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 256}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'in_ptr2': 'fp64', 'out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=2, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_unsqueeze_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 3, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 4096}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_unsqueeze_0(in_ptr0, in_ptr1, in_ptr2, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp3 = in_ptr2 + tmp2 = tmp0 * tmp1 + tmp4 = tmp3.to(tl.float32) + tmp5 = tmp2 * tmp4 + tl.store(out_ptr0 + (x0), tmp5, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1 = args + args.clear() + s7 = arg0_1 + s3 = arg1_1 + arg2_1_size = arg2_1.size() + s0 = arg2_1_size[0] + assert_size_stride(arg2_1, (s0, s3), (s3, 1)) + assert_size_stride(arg3_1, (s0, s3, 1), (s3, 1, 1)) + assert_size_stride(arg4_1, (), ()) + with torch.cuda._DeviceGuard(2): + torch.cuda.set_device(2) + buf0 = empty_strided_cuda((s0, s3, 1), (s3, 1, 1), torch.float32) + # Topologically Sorted Source Nodes: [unsqueeze, mul], Original ATen: [aten.unsqueeze, aten.mul] + triton_poi_fused_mul_unsqueeze_0_xnumel = s0*s3 + stream2 = get_raw_stream(2) + triton_poi_fused_mul_unsqueeze_0.run(arg2_1, arg3_1, arg4_1.item(), buf0, triton_poi_fused_mul_unsqueeze_0_xnumel, stream=stream2) + del arg2_1 + del arg3_1 + del arg4_1 + return (buf0, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = 8 + arg1_1 = 32 + arg2_1 = rand_strided((8, 32), (32, 1), device='cuda:2', dtype=torch.float32) + arg3_1 = rand_strided((8, 32, 1), (32, 1, 1), device='cuda:2', dtype=torch.float32) + arg4_1 = rand_strided((), (), device='cpu', dtype=torch.float64) + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/ir/0255378f1ce335364fa36d9bc21caee968f5be38303b5c256f95c4911bfcef07.best_config b/.inductor_cache/ir/0255378f1ce335364fa36d9bc21caee968f5be38303b5c256f95c4911bfcef07.best_config new file mode 100644 index 0000000000000000000000000000000000000000..ceb8ef25d450884e0fedce18ea088043d16dcf7f --- /dev/null +++ b/.inductor_cache/ir/0255378f1ce335364fa36d9bc21caee968f5be38303b5c256f95c4911bfcef07.best_config @@ -0,0 +1 @@ +{"XBLOCK": 128, "num_warps": 4, "num_stages": 1, "configs_hash": "1b2cc4dbebb9680d3ce31843331593b159e4046c056f195ca1ccf2464d5b37d1", "found_by_coordesc": false, "time_taken_ms": 22, "triton_cache_hash": "Q2N5PO2YINGSELIO3M4VOOWLWHTNDJUQK2K7ETAZL7ECQK6GFLMA"} \ No newline at end of file diff --git a/.inductor_cache/ir/cir5ti23wbsresyfgmjkv6vlndvb6rvqqgimar4odcyrxtryphd6.py b/.inductor_cache/ir/cir5ti23wbsresyfgmjkv6vlndvb6rvqqgimar4odcyrxtryphd6.py new file mode 100644 index 0000000000000000000000000000000000000000..bd3e5513a272bf63e1a632bef6394feee1ed256f --- /dev/null +++ b/.inductor_cache/ir/cir5ti23wbsresyfgmjkv6vlndvb6rvqqgimar4odcyrxtryphd6.py @@ -0,0 +1,127 @@ +# AOT ID: ['9_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/3h/c3hzz247khkgmf7sy4wb5vbaz4z24jsfnh2gf3spavzjd7bow5gg.py +# Topologically Sorted Source Nodes: [weights_1], Original ATen: [aten.mul] +# Source node to ATen node mapping: +# weights_1 => mul +# Graph fragment: +# %mm : Tensor "f32[1, 32][32, 1]cuda:5" = PlaceHolder[target=mm] +# %mul : Tensor "f32[1, 32][32, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mm, 0.1767766952966369), kwargs = {}) +# return %mul +triton_poi_fused_mul_0 = async_compile.triton('triton_poi_fused_mul_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 32}, + filename=__file__, + triton_meta={'signature': {'in_out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=5, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_0', 'mutated_arg_names': ['in_out_ptr0'], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 384}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_0(in_out_ptr0, xnumel, XBLOCK : tl.constexpr): + xnumel = 32 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_out_ptr0 + (x0), xmask) + tmp1 = tl.full([1], 0.1767766952966369, tl.float32) + tmp2 = tmp0 * tmp1 + tl.store(in_out_ptr0 + (x0), tmp2, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1 = args + args.clear() + assert_size_stride(arg0_1, (32, 6144), (6144, 1)) + assert_size_stride(arg1_1, (1, 6144), (6144, 1)) + with torch.cuda._DeviceGuard(5): + torch.cuda.set_device(5) + buf0 = empty_strided_cuda((1, 32), (32, 1), torch.float32) + # Topologically Sorted Source Nodes: [t, weights], Original ATen: [aten.t, aten.mm] + extern_kernels.mm_dtype(arg1_1, reinterpret_tensor(arg0_1, (6144, 32), (1, 6144), 0), out_dtype=torch.float32, out=buf0) + del arg0_1 + del arg1_1 + buf1 = buf0; del buf0 # reuse + # Topologically Sorted Source Nodes: [weights_1], Original ATen: [aten.mul] + stream5 = get_raw_stream(5) + triton_poi_fused_mul_0.run(buf1, 32, stream=stream5) + return (buf1, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = rand_strided((32, 6144), (6144, 1), device='cuda:5', dtype=torch.bfloat16) + arg1_1 = rand_strided((1, 6144), (6144, 1), device='cuda:5', dtype=torch.bfloat16) + return [arg0_1, arg1_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/ir/ciraka3wgfcuxvxpzuwxqayxo6awnanmhjy5k5dqxsfqnzlnzqb7.py b/.inductor_cache/ir/ciraka3wgfcuxvxpzuwxqayxo6awnanmhjy5k5dqxsfqnzlnzqb7.py new file mode 100644 index 0000000000000000000000000000000000000000..e71a130f0bb4ac9e2e67b76a10b0a32162007bcd --- /dev/null +++ b/.inductor_cache/ir/ciraka3wgfcuxvxpzuwxqayxo6awnanmhjy5k5dqxsfqnzlnzqb7.py @@ -0,0 +1,24 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 16384}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*bf16', 'out_ptr0': '*bf16', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=5, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 73728}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x2 = xindex + tmp0 = tl.load(in_ptr0 + (x2), xmask, eviction_policy='evict_last').to(tl.float32) + tl.store(out_ptr0 + (x2), tmp0, xmask) diff --git a/.inductor_cache/iy/9abc86d25ed09d9e90e659619bcc61fbb8f9a28016ddfc08ad00d90bf69d38bd.best_config b/.inductor_cache/iy/9abc86d25ed09d9e90e659619bcc61fbb8f9a28016ddfc08ad00d90bf69d38bd.best_config new file mode 100644 index 0000000000000000000000000000000000000000..dd6abf16e86d437b3f6c758461775fe7672e603d --- /dev/null +++ b/.inductor_cache/iy/9abc86d25ed09d9e90e659619bcc61fbb8f9a28016ddfc08ad00d90bf69d38bd.best_config @@ -0,0 +1 @@ +{"XBLOCK": 256, "num_warps": 4, "num_stages": 1, "configs_hash": "1b2cc4dbebb9680d3ce31843331593b159e4046c056f195ca1ccf2464d5b37d1", "found_by_coordesc": false, "time_taken_ms": 22, "triton_cache_hash": "5FUAZKDVQOXOEQJ4ZSRVOWBR6F6PBWI7HIJDQ3SM267VH2IXPT5A"} \ No newline at end of file diff --git a/.inductor_cache/iy/ciyckypghoehvvsvyj2fgefzwp4bhbzhzadklx53ll3uvb2rkphp.py b/.inductor_cache/iy/ciyckypghoehvvsvyj2fgefzwp4bhbzhzadklx53ll3uvb2rkphp.py new file mode 100644 index 0000000000000000000000000000000000000000..f91673b15db91f97425b32e6b8a3ea36ba42f580 --- /dev/null +++ b/.inductor_cache/iy/ciyckypghoehvvsvyj2fgefzwp4bhbzhzadklx53ll3uvb2rkphp.py @@ -0,0 +1,29 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 256}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'in_ptr2': 'fp64', 'out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=7, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_unsqueeze_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 3, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 4096}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_unsqueeze_0(in_ptr0, in_ptr1, in_ptr2, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp3 = in_ptr2 + tmp2 = tmp0 * tmp1 + tmp4 = tmp3.to(tl.float32) + tmp5 = tmp2 * tmp4 + tl.store(out_ptr0 + (x0), tmp5, xmask) diff --git a/.inductor_cache/j3/cj3b6qhvt2ytxuedrtr3m3b65j7ypc27vuaomc5pc35ce4r3x4sz.py b/.inductor_cache/j3/cj3b6qhvt2ytxuedrtr3m3b65j7ypc27vuaomc5pc35ce4r3x4sz.py new file mode 100644 index 0000000000000000000000000000000000000000..50ee48ce1c79a79c1c8e92f92f29cb5c1f1452d2 --- /dev/null +++ b/.inductor_cache/j3/cj3b6qhvt2ytxuedrtr3m3b65j7ypc27vuaomc5pc35ce4r3x4sz.py @@ -0,0 +1,45 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'ks0': 'i64', 'ks1': 'i64', 'ks2': 'i64', 'ks3': 'i64', 'ks4': 'i64', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=1, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_bitwise_and_bitwise_or_ge_lt_mul_sub_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_bitwise_and_bitwise_or_ge_lt_mul_sub_0(in_ptr0, out_ptr0, ks0, ks1, ks2, ks3, ks4, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = tl.load(in_ptr0 + (0)) + tmp1 = tl.broadcast_to(tmp0, [XBLOCK]) + tmp2 = ks0 + tmp3 = tmp1 >= tmp2 + tmp4 = ks1 + tmp5 = tmp1 < tmp4 + tmp6 = tmp3 & tmp5 + tmp7 = ks2 + tmp8 = tmp1 >= tmp7 + tmp9 = ks3 + tmp10 = tmp1 < tmp9 + tmp11 = tmp8 & tmp10 + tmp12 = tmp6 | tmp11 + tmp13 = tmp12.to(tl.int64) + tmp14 = tmp6.to(tl.int64) + tmp15 = tmp14 * tmp2 + tmp16 = tmp11.to(tl.int64) + tmp17 = ks0 + ks2 + ((-1)*ks1) + ((-1)*ks4) + tmp18 = tmp16 * tmp17 + tmp19 = tmp15 + tmp18 + tmp20 = tmp1 - tmp19 + tmp21 = tmp13 * tmp20 + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp21, None) diff --git a/.inductor_cache/j5/6358a16b01d796a0070aed538da67ec8e500e1609383a251623acdc67e2bee8e.best_config b/.inductor_cache/j5/6358a16b01d796a0070aed538da67ec8e500e1609383a251623acdc67e2bee8e.best_config new file mode 100644 index 0000000000000000000000000000000000000000..8ea323f748a9d5acd6377c1908e47a4a24aa3ada --- /dev/null +++ b/.inductor_cache/j5/6358a16b01d796a0070aed538da67ec8e500e1609383a251623acdc67e2bee8e.best_config @@ -0,0 +1 @@ +{"XBLOCK": 128, "num_warps": 4, "num_stages": 1, "configs_hash": "1b2cc4dbebb9680d3ce31843331593b159e4046c056f195ca1ccf2464d5b37d1", "found_by_coordesc": false, "time_taken_ms": 21, "triton_cache_hash": "YG74CS4JHDXVAWUXP7QZ23NAXRAHIYIZ5FUJMRPVXQLZO4XINHZA"} \ No newline at end of file diff --git a/.inductor_cache/j5/cj5oje4hpl2s4bh465oo42uxpfb5opej5d4uifpm3xb2u3kphked.py b/.inductor_cache/j5/cj5oje4hpl2s4bh465oo42uxpfb5opej5d4uifpm3xb2u3kphked.py new file mode 100644 index 0000000000000000000000000000000000000000..315e69c1872ccd54c351e1ad6e80b64abb43a6a6 --- /dev/null +++ b/.inductor_cache/j5/cj5oje4hpl2s4bh465oo42uxpfb5opej5d4uifpm3xb2u3kphked.py @@ -0,0 +1,29 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 256}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'in_ptr2': 'fp64', 'out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=3, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_unsqueeze_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 3, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 4096}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_unsqueeze_0(in_ptr0, in_ptr1, in_ptr2, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp3 = in_ptr2 + tmp2 = tmp0 * tmp1 + tmp4 = tmp3.to(tl.float32) + tmp5 = tmp2 * tmp4 + tl.store(out_ptr0 + (x0), tmp5, xmask) diff --git a/.inductor_cache/jc/cjcyef6l2czeuo2a7x4mwn3rsfjkqr3hptnepxfcd2t5dwpbbotu.py b/.inductor_cache/jc/cjcyef6l2czeuo2a7x4mwn3rsfjkqr3hptnepxfcd2t5dwpbbotu.py new file mode 100644 index 0000000000000000000000000000000000000000..8180632852bd83bf2c03a005d906b82919d11d56 --- /dev/null +++ b/.inductor_cache/jc/cjcyef6l2czeuo2a7x4mwn3rsfjkqr3hptnepxfcd2t5dwpbbotu.py @@ -0,0 +1,289 @@ +# AOT ID: ['11_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/nq/cnqbp6kjluj4ekcqcep6mzlu4tc72vz5b6ebts34lz2rh6egs2zg.py +# Topologically Sorted Source Nodes: [unsqueeze, view, expand_scores, flatten, max_1], Original ATen: [aten.unsqueeze, aten.view, aten.mul, aten.max] +# Source node to ATen node mapping: +# expand_scores => mul_1 +# flatten => view_1 +# max_1 => getitem, max_1 +# unsqueeze => unsqueeze +# view => view +# Graph fragment: +# %arg1_1 : Tensor "f32[1, 1][1, 1]cuda:1" = PlaceHolder[target=arg1_1] +# %arg2_1 : Tensor "f32[1, 1][1, 1]cuda:1" = PlaceHolder[target=arg2_1] +# %mul_1 : Tensor "f32[1, 1, 1][1, 1, 1]cuda:1" = PlaceHolder[target=mul_1] +# %unsqueeze : Tensor "f32[1, 1, 1][1, 1, 1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%arg1_1, 2), kwargs = {}) +# %view : Tensor "f32[1, 1, 1][1, 1, 1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%arg2_1, [-1, 1, 1]), kwargs = {}) +# %mul_1 : Tensor "f32[1, 1, 1][1, 1, 1]cuda:1"[num_users=2] = call_function[target=torch.ops.aten.mul.Tensor](args = (%unsqueeze, %view), kwargs = {}) +# %view_1 : Tensor "f32[1, 1][1, 1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_1, [1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %getitem : Tensor "f32[1, 1][1, 1]cuda:1"[num_users=1] = call_function[target=operator.getitem](args = (%max_1, 0), kwargs = {}) +# return %mul_1,%getitem +triton_poi_fused_max_mul_unsqueeze_view_0 = async_compile.triton('triton_poi_fused_max_mul_unsqueeze_view_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'out_ptr0': '*fp32', 'out_ptr1': '*fp32', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=1, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_max_mul_unsqueeze_view_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 2, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_max_mul_unsqueeze_view_0(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = tl.load(in_ptr0 + (0)) + tmp1 = tl.broadcast_to(tmp0, [XBLOCK]) + tmp2 = tl.load(in_ptr1 + (0)) + tmp3 = tl.broadcast_to(tmp2, [XBLOCK]) + tmp4 = tmp1 * tmp3 + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp4, None) + tl.store(out_ptr1 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp4, None) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/vp/cvpzx2kdchqc6guwkindqyt546rfti3d3jlajkry5ty3obvnc3b6.py +# Topologically Sorted Source Nodes: [flatten, max_1, gather], Original ATen: [aten.view, aten.max, aten.gather] +# Source node to ATen node mapping: +# flatten => view_1 +# gather => gather +# max_1 => max_1 +# Graph fragment: +# %arg3_1 : Tensor "i64[1, 1][1, 1]cuda:1" = PlaceHolder[target=arg3_1] +# %view_1 : Tensor "f32[1, 1][1, 1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_1, [1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %gather : Tensor "i64[1, 1][1, 1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.gather.default](args = (%arg3_1, 1, %getitem_1), kwargs = {}) +# return %gather +triton_poi_fused_gather_max_view_1 = async_compile.triton('triton_poi_fused_gather_max_view_1', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=1, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_gather_max_view_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_gather_max_view_1(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = tl.load(in_ptr0 + (0)) + tmp1 = tl.broadcast_to(tmp0, [XBLOCK]) + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp1, None) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/qa/cqanpbkinyjt34of6jalwizrn65fcwlbt4ak3bptqfociplwus7q.py +# Topologically Sorted Source Nodes: [flatten, max_1, flat_cs, floordiv, batch_offsets, repeat_interleave, selected_input_index, hidden_states], Original ATen: [aten.view, aten.max, aten.floor_divide, aten.arange, aten.unsqueeze, aten.add, aten.index] +# Source node to ATen node mapping: +# batch_offsets => iota +# flat_cs => view_4 +# flatten => view_1 +# floordiv => div +# hidden_states => index +# max_1 => max_1 +# repeat_interleave => unsqueeze_1, view_5 +# selected_input_index => add +# Graph fragment: +# %arg5_1 : Tensor "bf16[1, s87][s87, 1]cuda:1" = PlaceHolder[target=arg5_1] +# %view_1 : Tensor "f32[1, 1][1, 1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_1, [1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %view_4 : Tensor "i64[1][1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%getitem_1, [1]), kwargs = {}) +# %div : Tensor "i64[1][1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.div.Tensor_mode](args = (%view_4, 1), kwargs = {rounding_mode: floor}) +# %iota : Tensor "i64[1][1]cuda:1"[num_users=1] = call_function[target=torch.ops.prims.iota.default](args = (1,), kwargs = {start: 0, step: 1, dtype: torch.int64, device: cuda:1, requires_grad: False}) +# %unsqueeze_1 : Tensor "i64[1, 1][1, 1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%iota, 1), kwargs = {}) +# %view_5 : Tensor "i64[1][1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%expand, [1]), kwargs = {}) +# %add : Tensor "i64[1][1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%div, %view_5), kwargs = {}) +# %index : Tensor "bf16[1, s87][s87, 1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.index.Tensor](args = (%arg5_1, [%add]), kwargs = {}) +# return %index +triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2 = async_compile.triton('triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8192}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*bf16', 'out_ptr0': '*bf16', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=1, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 36864}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask).to(tl.float32) + tl.store(out_ptr0 + (x0), tmp0, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/t3/ct3zvfrlnhneovetk46gervdzkofwrmdqwocqcysjyfr3bhpgjdm.py +# Topologically Sorted Source Nodes: [flatten, max_1, add_2], Original ATen: [aten.view, aten.max, aten.add] +# Source node to ATen node mapping: +# add_2 => add_3 +# flatten => view_1 +# max_1 => max_1 +# Graph fragment: +# %view_1 : Tensor "f32[1, 1][1, 1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_1, [1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %add_3 : Tensor "i64[1, 1][1, 1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%getitem_1, %arg6_1), kwargs = {}) +# return %add_3 +triton_poi_fused_add_max_view_3 = async_compile.triton('triton_poi_fused_add_max_view_3', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'out_ptr0': '*i64', 'ks0': 'i64', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=1, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_max_view_3', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 0, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_max_view_3(out_ptr0, ks0, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = ks0 + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32)), tmp0, None) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1 = args + args.clear() + s53 = arg0_1 + s87 = arg4_1 + s77 = arg6_1 + assert_size_stride(arg1_1, (1, 1), (1, 1)) + assert_size_stride(arg2_1, (1, 1), (1, 1)) + assert_size_stride(arg3_1, (1, 1), (1, 1)) + assert_size_stride(arg5_1, (1, s87), (s87, 1)) + with torch.cuda._DeviceGuard(1): + torch.cuda.set_device(1) + buf0 = empty_strided_cuda((1, 1, 1), (1, 1, 1), torch.float32) + buf1 = empty_strided_cuda((1, 1), (1, 1), torch.float32) + # Topologically Sorted Source Nodes: [unsqueeze, view, expand_scores, flatten, max_1], Original ATen: [aten.unsqueeze, aten.view, aten.mul, aten.max] + stream1 = get_raw_stream(1) + triton_poi_fused_max_mul_unsqueeze_view_0.run(arg1_1, arg2_1, buf0, buf1, 1, stream=stream1) + del arg1_1 + del arg2_1 + buf2 = empty_strided_cuda((1, 1), (1, 1), torch.int64) + # Topologically Sorted Source Nodes: [flatten, max_1, gather], Original ATen: [aten.view, aten.max, aten.gather] + stream1 = get_raw_stream(1) + triton_poi_fused_gather_max_view_1.run(arg3_1, buf2, 1, stream=stream1) + buf3 = empty_strided_cuda((1, s87), (s87, 1), torch.bfloat16) + # Topologically Sorted Source Nodes: [flatten, max_1, flat_cs, floordiv, batch_offsets, repeat_interleave, selected_input_index, hidden_states], Original ATen: [aten.view, aten.max, aten.floor_divide, aten.arange, aten.unsqueeze, aten.add, aten.index] + stream1 = get_raw_stream(1) + triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2.run(arg5_1, buf3, s87, stream=stream1) + del arg5_1 + buf4 = empty_strided_cuda((1, 1), (1, 1), torch.int64) + # Topologically Sorted Source Nodes: [flatten, max_1, add_2], Original ATen: [aten.view, aten.max, aten.add] + stream1 = get_raw_stream(1) + triton_poi_fused_add_max_view_3.run(buf4, s77, 1, stream=stream1) + return (reinterpret_tensor(buf2, (1, ), (1, ), 0), buf3, buf1, buf0, arg3_1, buf4, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = 1 + arg1_1 = rand_strided((1, 1), (1, 1), device='cuda:1', dtype=torch.float32) + arg2_1 = rand_strided((1, 1), (1, 1), device='cuda:1', dtype=torch.float32) + arg3_1 = rand_strided((1, 1), (1, 1), device='cuda:1', dtype=torch.int64) + arg4_1 = 6144 + arg5_1 = rand_strided((1, 6144), (6144, 1), device='cuda:1', dtype=torch.bfloat16) + arg6_1 = 1 + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/ji/cjixch55bogwekijx7a5djy4i4bejme7e6ialt2qal4iibhwdhel.py b/.inductor_cache/ji/cjixch55bogwekijx7a5djy4i4bejme7e6ialt2qal4iibhwdhel.py new file mode 100644 index 0000000000000000000000000000000000000000..57e38a0708fc91c5e6b956ef9ff7eabcb1b987f5 --- /dev/null +++ b/.inductor_cache/ji/cjixch55bogwekijx7a5djy4i4bejme7e6ialt2qal4iibhwdhel.py @@ -0,0 +1,25 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=0, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_gather_max_view_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_gather_max_view_1(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = tl.load(in_ptr0 + (0)) + tmp1 = tl.broadcast_to(tmp0, [XBLOCK]) + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp1, None) diff --git a/.inductor_cache/jk/cjk2l5do5kfebmlafwv2ddtivblyn54wzypw3yv4cn4tgq7w7p46.py b/.inductor_cache/jk/cjk2l5do5kfebmlafwv2ddtivblyn54wzypw3yv4cn4tgq7w7p46.py new file mode 100644 index 0000000000000000000000000000000000000000..f03f8c927b0b5589789c6df89d6dc9ba5cb035dd --- /dev/null +++ b/.inductor_cache/jk/cjk2l5do5kfebmlafwv2ddtivblyn54wzypw3yv4cn4tgq7w7p46.py @@ -0,0 +1,24 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=0, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_gather_max_view_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 192}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_gather_max_view_1(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tl.store(out_ptr0 + (x0), tmp0, xmask) diff --git a/.inductor_cache/jr/cjrkeuk4xjhx774cklsib5ivf4nd32eudc4tub7gpkw5nbrgpf7w.py b/.inductor_cache/jr/cjrkeuk4xjhx774cklsib5ivf4nd32eudc4tub7gpkw5nbrgpf7w.py new file mode 100644 index 0000000000000000000000000000000000000000..beed558a5efb074f64bb90f3195ae38751d5c20c --- /dev/null +++ b/.inductor_cache/jr/cjrkeuk4xjhx774cklsib5ivf4nd32eudc4tub7gpkw5nbrgpf7w.py @@ -0,0 +1,46 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 128}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'out_ptr1': '*i1', 'ks0': 'i64', 'ks1': 'i64', 'ks2': 'i64', 'ks3': 'i64', 'ks4': 'i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=7, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_bitwise_and_bitwise_not_bitwise_or_ge_lt_mul_sub_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 2912}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_bitwise_and_bitwise_not_bitwise_or_ge_lt_mul_sub_0(in_ptr0, out_ptr0, out_ptr1, ks0, ks1, ks2, ks3, ks4, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = ks0 + tmp2 = tmp0 >= tmp1 + tmp3 = ks1 + tmp4 = tmp0 < tmp3 + tmp5 = tmp2 & tmp4 + tmp6 = ks2 + tmp7 = tmp0 >= tmp6 + tmp8 = ks3 + tmp9 = tmp0 < tmp8 + tmp10 = tmp7 & tmp9 + tmp11 = tmp5 | tmp10 + tmp12 = tmp11.to(tl.int64) + tmp13 = tmp5.to(tl.int64) + tmp14 = tmp13 * tmp1 + tmp15 = tmp10.to(tl.int64) + tmp16 = ks0 + ks2 + ((-1)*ks1) + ((-1)*ks4) + tmp17 = tmp15 * tmp16 + tmp18 = tmp14 + tmp17 + tmp19 = tmp0 - tmp18 + tmp20 = tmp12 * tmp19 + tmp21 = tmp11 == 0 + tl.store(out_ptr0 + (x0), tmp20, xmask) + tl.store(out_ptr1 + (x0), tmp21, xmask) diff --git a/.inductor_cache/jt/cjtkmsmsmr7qd5ioimpa7bu7jp4mskbficcpsjglg3pwmbsuyoq6.py b/.inductor_cache/jt/cjtkmsmsmr7qd5ioimpa7bu7jp4mskbficcpsjglg3pwmbsuyoq6.py new file mode 100644 index 0000000000000000000000000000000000000000..37bd8d645e545bc9e4640dfcb6b1a6d3c538764c --- /dev/null +++ b/.inductor_cache/jt/cjtkmsmsmr7qd5ioimpa7bu7jp4mskbficcpsjglg3pwmbsuyoq6.py @@ -0,0 +1,27 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 2}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'out_ptr0': '*fp32', 'out_ptr1': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=6, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_max_mul_unsqueeze_view_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 2, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 12}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_max_mul_unsqueeze_view_0(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp2 = tmp0 * tmp1 + tl.store(out_ptr0 + (x0), tmp2, xmask) + tl.store(out_ptr1 + (x0), tmp2, xmask) diff --git a/.inductor_cache/jv/cjvqcxja6ql663g5qqhwdxypmfc3mpqhkof2i5mcdxy3zgvdfwoc.py b/.inductor_cache/jv/cjvqcxja6ql663g5qqhwdxypmfc3mpqhkof2i5mcdxy3zgvdfwoc.py new file mode 100644 index 0000000000000000000000000000000000000000..a969ed9e01f8c117af69d75c60fb3b50ad56413e --- /dev/null +++ b/.inductor_cache/jv/cjvqcxja6ql663g5qqhwdxypmfc3mpqhkof2i5mcdxy3zgvdfwoc.py @@ -0,0 +1,25 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=6, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_gather_max_view_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_gather_max_view_1(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = tl.load(in_ptr0 + (0)) + tmp1 = tl.broadcast_to(tmp0, [XBLOCK]) + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp1, None) diff --git a/.inductor_cache/jw/cjwnm4nhtti6dx4kp7rcgvjpxw7ab72wy3zgvwtnnqtlbtlmkzlu.py b/.inductor_cache/jw/cjwnm4nhtti6dx4kp7rcgvjpxw7ab72wy3zgvwtnnqtlbtlmkzlu.py new file mode 100644 index 0000000000000000000000000000000000000000..717d5ab0aa374ed6804bbf48a3f30bd4f26ac3dc --- /dev/null +++ b/.inductor_cache/jw/cjwnm4nhtti6dx4kp7rcgvjpxw7ab72wy3zgvwtnnqtlbtlmkzlu.py @@ -0,0 +1,24 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=3, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_gather_max_view_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 192}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_gather_max_view_1(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tl.store(out_ptr0 + (x0), tmp0, xmask) diff --git a/.inductor_cache/k2/ck2xmasodpr5uqwaulpl326wvcqp2ct3sykkwhqhob3i6jwnlihz.py b/.inductor_cache/k2/ck2xmasodpr5uqwaulpl326wvcqp2ct3sykkwhqhob3i6jwnlihz.py new file mode 100644 index 0000000000000000000000000000000000000000..b4f037f4ae52f0e295a4861a4ee0c6425f0a2f56 --- /dev/null +++ b/.inductor_cache/k2/ck2xmasodpr5uqwaulpl326wvcqp2ct3sykkwhqhob3i6jwnlihz.py @@ -0,0 +1,24 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 2}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=5, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_gather_max_view_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 12}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_gather_max_view_1(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tl.store(out_ptr0 + (x0), tmp0, xmask) diff --git a/.inductor_cache/k6/ck6gzeeqfkly6grtahl6izovjs2ow6g33i537gy2va6cgwymmklt.py b/.inductor_cache/k6/ck6gzeeqfkly6grtahl6izovjs2ow6g33i537gy2va6cgwymmklt.py new file mode 100644 index 0000000000000000000000000000000000000000..483e3d09d9a7ceabd6ec230dad78e46315bebb38 --- /dev/null +++ b/.inductor_cache/k6/ck6gzeeqfkly6grtahl6izovjs2ow6g33i537gy2va6cgwymmklt.py @@ -0,0 +1,27 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 2}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'out_ptr0': '*fp32', 'out_ptr1': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=0, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_max_mul_unsqueeze_view_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 2, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 12}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_max_mul_unsqueeze_view_0(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp2 = tmp0 * tmp1 + tl.store(out_ptr0 + (x0), tmp2, xmask) + tl.store(out_ptr1 + (x0), tmp2, xmask) diff --git a/.inductor_cache/ka/8254fd6ca04ac1e11dd1488df480e3c1891350e716932f5e1434e607133470b5.best_config b/.inductor_cache/ka/8254fd6ca04ac1e11dd1488df480e3c1891350e716932f5e1434e607133470b5.best_config new file mode 100644 index 0000000000000000000000000000000000000000..f1e72ad2bd0734de4cf8c10232ccd2e21adddc5e --- /dev/null +++ b/.inductor_cache/ka/8254fd6ca04ac1e11dd1488df480e3c1891350e716932f5e1434e607133470b5.best_config @@ -0,0 +1 @@ +{"XBLOCK": 256, "num_warps": 4, "num_stages": 1, "configs_hash": "1b2cc4dbebb9680d3ce31843331593b159e4046c056f195ca1ccf2464d5b37d1", "found_by_coordesc": false, "time_taken_ms": 75, "triton_cache_hash": "K7P5VUQTWQ2GR5KCWBMAJUJLJ4ZOKI2HSLQM523UQ5RBJFUB5GQA"} \ No newline at end of file diff --git a/.inductor_cache/ka/cka2o67gzlydxyz2setxkrfr6kb64dtelf3qrrwl5cwfxy56esqx.py b/.inductor_cache/ka/cka2o67gzlydxyz2setxkrfr6kb64dtelf3qrrwl5cwfxy56esqx.py new file mode 100644 index 0000000000000000000000000000000000000000..7d55b37c073627c3fea4cea95213e76903d194ac --- /dev/null +++ b/.inductor_cache/ka/cka2o67gzlydxyz2setxkrfr6kb64dtelf3qrrwl5cwfxy56esqx.py @@ -0,0 +1,26 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 256}, + filename=__file__, + triton_meta={'signature': {'in_out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=3, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_0', 'mutated_arg_names': ['in_out_ptr0'], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 3072}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_0(in_out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_out_ptr0 + (x0), xmask) + tmp1 = tl.full([1], 0.1767766952966369, tl.float32) + tmp2 = tmp0 * tmp1 + tl.store(in_out_ptr0 + (x0), tmp2, xmask) diff --git a/.inductor_cache/ki/807861c9e98a1f14b060724c8daa33eda9dd56491a9c517ee510381d705e2106.best_config b/.inductor_cache/ki/807861c9e98a1f14b060724c8daa33eda9dd56491a9c517ee510381d705e2106.best_config new file mode 100644 index 0000000000000000000000000000000000000000..ceb8ef25d450884e0fedce18ea088043d16dcf7f --- /dev/null +++ b/.inductor_cache/ki/807861c9e98a1f14b060724c8daa33eda9dd56491a9c517ee510381d705e2106.best_config @@ -0,0 +1 @@ +{"XBLOCK": 128, "num_warps": 4, "num_stages": 1, "configs_hash": "1b2cc4dbebb9680d3ce31843331593b159e4046c056f195ca1ccf2464d5b37d1", "found_by_coordesc": false, "time_taken_ms": 22, "triton_cache_hash": "Q2N5PO2YINGSELIO3M4VOOWLWHTNDJUQK2K7ETAZL7ECQK6GFLMA"} \ No newline at end of file diff --git a/.inductor_cache/ki/ckijd3g3dwsrqk5o3zjxohkv32tjipmuudawexakd3g2v5jm5qh4.py b/.inductor_cache/ki/ckijd3g3dwsrqk5o3zjxohkv32tjipmuudawexakd3g2v5jm5qh4.py new file mode 100644 index 0000000000000000000000000000000000000000..df1df38585447f59bcbedf3b161629fca8da7fb6 --- /dev/null +++ b/.inductor_cache/ki/ckijd3g3dwsrqk5o3zjxohkv32tjipmuudawexakd3g2v5jm5qh4.py @@ -0,0 +1,24 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 16384}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*bf16', 'out_ptr0': '*bf16', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=0, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 73728}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x2 = xindex + tmp0 = tl.load(in_ptr0 + (x2), xmask, eviction_policy='evict_last').to(tl.float32) + tl.store(out_ptr0 + (x2), tmp0, xmask) diff --git a/.inductor_cache/kl/cklqgwaw6itfxulzz2tchyng25fplp27wqdm4ti3a64ab4rp5ja4.py b/.inductor_cache/kl/cklqgwaw6itfxulzz2tchyng25fplp27wqdm4ti3a64ab4rp5ja4.py new file mode 100644 index 0000000000000000000000000000000000000000..60a6e6159684213391d1a55deaef4bce4a8ba4ce --- /dev/null +++ b/.inductor_cache/kl/cklqgwaw6itfxulzz2tchyng25fplp27wqdm4ti3a64ab4rp5ja4.py @@ -0,0 +1,293 @@ +# AOT ID: ['13_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/la/claldzplizwfwkcjty6ddw7gqqur77xycf4hw5y5ep3rzmu3rd2p.py +# Topologically Sorted Source Nodes: [unsqueeze, view, expand_scores, flatten, max_1], Original ATen: [aten.unsqueeze, aten.view, aten.mul, aten.max] +# Source node to ATen node mapping: +# expand_scores => mul_3 +# flatten => view_1 +# max_1 => getitem, max_1 +# unsqueeze => unsqueeze +# view => view +# Graph fragment: +# %arg2_1 : Tensor "f32[s0, 1][1, 1]cuda:5" = PlaceHolder[target=arg2_1] +# %arg4_1 : Tensor "f32[s0, 1][1, 1]cuda:5" = PlaceHolder[target=arg4_1] +# %mul_3 : Tensor "f32[s0, 1, 1][1, 1, 1]cuda:5" = PlaceHolder[target=mul_3] +# %unsqueeze : Tensor "f32[s0, 1, 1][1, 1, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%arg2_1, 2), kwargs = {}) +# %view : Tensor "f32[s0, 1, 1][1, 1, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%arg4_1, [-1, 1, 1]), kwargs = {}) +# %mul_3 : Tensor "f32[s0, 1, 1][1, 1, 1]cuda:5"[num_users=2] = call_function[target=torch.ops.aten.mul.Tensor](args = (%unsqueeze, %view), kwargs = {}) +# %view_1 : Tensor "f32[s0, 1][1, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg3_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %getitem : Tensor "f32[s0, 1][1, 1]cuda:5"[num_users=1] = call_function[target=operator.getitem](args = (%max_1, 0), kwargs = {}) +# return %mul_3,%getitem +triton_poi_fused_max_mul_unsqueeze_view_0 = async_compile.triton('triton_poi_fused_max_mul_unsqueeze_view_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 2}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'out_ptr0': '*fp32', 'out_ptr1': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=5, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_max_mul_unsqueeze_view_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 2, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 12}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_max_mul_unsqueeze_view_0(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp2 = tmp0 * tmp1 + tl.store(out_ptr0 + (x0), tmp2, xmask) + tl.store(out_ptr1 + (x0), tmp2, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/k2/ck2xmasodpr5uqwaulpl326wvcqp2ct3sykkwhqhob3i6jwnlihz.py +# Topologically Sorted Source Nodes: [flatten, max_1, gather], Original ATen: [aten.view, aten.max, aten.gather] +# Source node to ATen node mapping: +# flatten => view_1 +# gather => gather +# max_1 => max_1 +# Graph fragment: +# %arg6_1 : Tensor "i64[s37, 1][1, 1]cuda:5" = PlaceHolder[target=arg6_1] +# %view_1 : Tensor "f32[s0, 1][1, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg3_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %gather : Tensor "i64[s0, 1][1, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.gather.default](args = (%arg6_1, 1, %getitem_1), kwargs = {}) +# return %gather +triton_poi_fused_gather_max_view_1 = async_compile.triton('triton_poi_fused_gather_max_view_1', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 2}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=5, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_gather_max_view_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 12}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_gather_max_view_1(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tl.store(out_ptr0 + (x0), tmp0, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/ir/ciraka3wgfcuxvxpzuwxqayxo6awnanmhjy5k5dqxsfqnzlnzqb7.py +# Topologically Sorted Source Nodes: [flatten, max_1, flat_cs, floordiv, batch_offsets, repeat_interleave, selected_input_index, hidden_states], Original ATen: [aten.view, aten.max, aten.floor_divide, aten.arange, aten.unsqueeze, aten.add, aten.index] +# Source node to ATen node mapping: +# batch_offsets => iota +# flat_cs => view_4 +# flatten => view_1 +# floordiv => div +# hidden_states => index +# max_1 => max_1 +# repeat_interleave => unsqueeze_1, view_5 +# selected_input_index => add_47 +# Graph fragment: +# %arg8_1 : Tensor "bf16[s0, s87][s87, 1]cuda:5" = PlaceHolder[target=arg8_1] +# %view_1 : Tensor "f32[s0, 1][1, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg3_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %view_4 : Tensor "i64[s0][1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%getitem_1, [%arg3_1]), kwargs = {}) +# %div : Tensor "i64[s0][1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.div.Tensor_mode](args = (%view_4, 1), kwargs = {rounding_mode: floor}) +# %iota : Tensor "i64[s0][1]cuda:5"[num_users=1] = call_function[target=torch.ops.prims.iota.default](args = (%arg3_1,), kwargs = {start: 0, step: 1, dtype: torch.int64, device: cuda:5, requires_grad: False}) +# %unsqueeze_1 : Tensor "i64[s0, 1][1, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%iota, 1), kwargs = {}) +# %view_5 : Tensor "i64[s0][1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%expand, [%arg3_1]), kwargs = {}) +# %add_47 : Tensor "i64[s0][1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%div, %view_5), kwargs = {}) +# %index : Tensor "bf16[s0, s87][s87, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.index.Tensor](args = (%arg8_1, [%add_47]), kwargs = {}) +# return %index +triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2 = async_compile.triton('triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 16384}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*bf16', 'out_ptr0': '*bf16', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=5, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 73728}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x2 = xindex + tmp0 = tl.load(in_ptr0 + (x2), xmask, eviction_policy='evict_last').to(tl.float32) + tl.store(out_ptr0 + (x2), tmp0, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/h2/ch2tjpsje4bsde7z3a4ler2mxok6q34ylpe7gwpix3ujjkwxo6me.py +# Topologically Sorted Source Nodes: [flatten, max_1, add_2], Original ATen: [aten.view, aten.max, aten.add] +# Source node to ATen node mapping: +# add_2 => add_53 +# flatten => view_1 +# max_1 => max_1 +# Graph fragment: +# %view_1 : Tensor "f32[s0, 1][1, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg3_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %add_53 : Tensor "i64[s0, 1][1, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%getitem_1, %arg9_1), kwargs = {}) +# return %add_53 +triton_poi_fused_add_max_view_3 = async_compile.triton('triton_poi_fused_add_max_view_3', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 2}, + filename=__file__, + triton_meta={'signature': {'out_ptr0': '*i64', 'ks0': 'i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=5, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_max_view_3', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 0, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 8}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_max_view_3(out_ptr0, ks0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = ks0 + tl.store(out_ptr0 + (x0), tmp0, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1, arg7_1, arg8_1, arg9_1 = args + args.clear() + s53 = arg0_1 + s68 = arg1_1 + s0 = arg3_1 + s37 = arg5_1 + s87 = arg7_1 + s77 = arg9_1 + assert_size_stride(arg2_1, (s0, 1), (1, 1)) + assert_size_stride(arg4_1, (s0, 1), (1, 1)) + assert_size_stride(arg6_1, (s37, 1), (1, 1)) + assert_size_stride(arg8_1, (s0, s87), (s87, 1)) + with torch.cuda._DeviceGuard(5): + torch.cuda.set_device(5) + buf0 = empty_strided_cuda((s0, 1, 1), (1, 1, 1), torch.float32) + buf1 = empty_strided_cuda((s0, 1), (1, 1), torch.float32) + # Topologically Sorted Source Nodes: [unsqueeze, view, expand_scores, flatten, max_1], Original ATen: [aten.unsqueeze, aten.view, aten.mul, aten.max] + stream5 = get_raw_stream(5) + triton_poi_fused_max_mul_unsqueeze_view_0.run(arg2_1, arg4_1, buf0, buf1, s0, stream=stream5) + del arg2_1 + del arg4_1 + buf2 = empty_strided_cuda((s0, 1), (1, 1), torch.int64) + # Topologically Sorted Source Nodes: [flatten, max_1, gather], Original ATen: [aten.view, aten.max, aten.gather] + stream5 = get_raw_stream(5) + triton_poi_fused_gather_max_view_1.run(arg6_1, buf2, s0, stream=stream5) + buf3 = empty_strided_cuda((s0, s87), (s87, 1), torch.bfloat16) + # Topologically Sorted Source Nodes: [flatten, max_1, flat_cs, floordiv, batch_offsets, repeat_interleave, selected_input_index, hidden_states], Original ATen: [aten.view, aten.max, aten.floor_divide, aten.arange, aten.unsqueeze, aten.add, aten.index] + triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2_xnumel = s0*s87 + stream5 = get_raw_stream(5) + triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2.run(arg8_1, buf3, triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2_xnumel, stream=stream5) + del arg8_1 + buf4 = empty_strided_cuda((s0, 1), (1, 1), torch.int64) + # Topologically Sorted Source Nodes: [flatten, max_1, add_2], Original ATen: [aten.view, aten.max, aten.add] + stream5 = get_raw_stream(5) + triton_poi_fused_add_max_view_3.run(buf4, s77, s0, stream=stream5) + return (reinterpret_tensor(buf2, (s0, ), (1, ), 0), buf3, buf1, buf0, arg6_1, buf4, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = 1 + arg1_1 = 2 + arg2_1 = rand_strided((2, 1), (1, 1), device='cuda:5', dtype=torch.float32) + arg3_1 = 2 + arg4_1 = rand_strided((2, 1), (1, 1), device='cuda:5', dtype=torch.float32) + arg5_1 = 2 + arg6_1 = rand_strided((2, 1), (1, 1), device='cuda:5', dtype=torch.int64) + arg7_1 = 6144 + arg8_1 = rand_strided((2, 6144), (6144, 1), device='cuda:5', dtype=torch.bfloat16) + arg9_1 = 1 + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1, arg7_1, arg8_1, arg9_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/kv/ckvsln7ha4pavxiq4tmskyfyfrhjtmmrzmzdvtv3giezgw5zmfeh.py b/.inductor_cache/kv/ckvsln7ha4pavxiq4tmskyfyfrhjtmmrzmzdvtv3giezgw5zmfeh.py new file mode 100644 index 0000000000000000000000000000000000000000..0d8c8b44f956ff28cb6b3e218c0acfd4f4fc9462 --- /dev/null +++ b/.inductor_cache/kv/ckvsln7ha4pavxiq4tmskyfyfrhjtmmrzmzdvtv3giezgw5zmfeh.py @@ -0,0 +1,24 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 16384}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*bf16', 'out_ptr0': '*bf16', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=6, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 73728}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x2 = xindex + tmp0 = tl.load(in_ptr0 + (x2), xmask, eviction_policy='evict_last').to(tl.float32) + tl.store(out_ptr0 + (x2), tmp0, xmask) diff --git a/.inductor_cache/kv/d5f663b9465f84e41feea10e7b5c618b8c67d3162db80a593cf7397c59957dcf.best_config b/.inductor_cache/kv/d5f663b9465f84e41feea10e7b5c618b8c67d3162db80a593cf7397c59957dcf.best_config new file mode 100644 index 0000000000000000000000000000000000000000..707fb02ad06a1f46c5f0bd52d07a08f3c71e5f54 --- /dev/null +++ b/.inductor_cache/kv/d5f663b9465f84e41feea10e7b5c618b8c67d3162db80a593cf7397c59957dcf.best_config @@ -0,0 +1 @@ +{"XBLOCK": 256, "num_warps": 4, "num_stages": 1, "configs_hash": "1b2cc4dbebb9680d3ce31843331593b159e4046c056f195ca1ccf2464d5b37d1", "found_by_coordesc": false, "time_taken_ms": 22, "triton_cache_hash": "QLXJTPJWIG7LHGEN76P7EYFUJIJLXLDECRO3I6NRHSQ4NBZC2KMA"} \ No newline at end of file diff --git a/.inductor_cache/kx/ckxxuqknipnrq6moqpornuulvtqunqyfqzz2fr2p6r3eizicrkyi.py b/.inductor_cache/kx/ckxxuqknipnrq6moqpornuulvtqunqyfqzz2fr2p6r3eizicrkyi.py new file mode 100644 index 0000000000000000000000000000000000000000..2e20bbf7735da832b4059a3ded5828b902b9079e --- /dev/null +++ b/.inductor_cache/kx/ckxxuqknipnrq6moqpornuulvtqunqyfqzz2fr2p6r3eizicrkyi.py @@ -0,0 +1,293 @@ +# AOT ID: ['13_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/k6/ck6gzeeqfkly6grtahl6izovjs2ow6g33i537gy2va6cgwymmklt.py +# Topologically Sorted Source Nodes: [unsqueeze, view, expand_scores, flatten, max_1], Original ATen: [aten.unsqueeze, aten.view, aten.mul, aten.max] +# Source node to ATen node mapping: +# expand_scores => mul_3 +# flatten => view_1 +# max_1 => getitem, max_1 +# unsqueeze => unsqueeze +# view => view +# Graph fragment: +# %arg2_1 : Tensor "f32[s0, 1][1, 1]cuda:0" = PlaceHolder[target=arg2_1] +# %arg4_1 : Tensor "f32[s0, 1][1, 1]cuda:0" = PlaceHolder[target=arg4_1] +# %mul_3 : Tensor "f32[s0, 1, 1][1, 1, 1]cuda:0" = PlaceHolder[target=mul_3] +# %unsqueeze : Tensor "f32[s0, 1, 1][1, 1, 1]cuda:0"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%arg2_1, 2), kwargs = {}) +# %view : Tensor "f32[s0, 1, 1][1, 1, 1]cuda:0"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%arg4_1, [-1, 1, 1]), kwargs = {}) +# %mul_3 : Tensor "f32[s0, 1, 1][1, 1, 1]cuda:0"[num_users=2] = call_function[target=torch.ops.aten.mul.Tensor](args = (%unsqueeze, %view), kwargs = {}) +# %view_1 : Tensor "f32[s0, 1][1, 1]cuda:0"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg3_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %getitem : Tensor "f32[s0, 1][1, 1]cuda:0"[num_users=1] = call_function[target=operator.getitem](args = (%max_1, 0), kwargs = {}) +# return %mul_3,%getitem +triton_poi_fused_max_mul_unsqueeze_view_0 = async_compile.triton('triton_poi_fused_max_mul_unsqueeze_view_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 2}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'out_ptr0': '*fp32', 'out_ptr1': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=0, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_max_mul_unsqueeze_view_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 2, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 12}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_max_mul_unsqueeze_view_0(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp2 = tmp0 * tmp1 + tl.store(out_ptr0 + (x0), tmp2, xmask) + tl.store(out_ptr1 + (x0), tmp2, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/tg/ctgzof7mc3offk5zjb7z5p6lj35m6e4wtwumojufxjz6tbjxwugw.py +# Topologically Sorted Source Nodes: [flatten, max_1, gather], Original ATen: [aten.view, aten.max, aten.gather] +# Source node to ATen node mapping: +# flatten => view_1 +# gather => gather +# max_1 => max_1 +# Graph fragment: +# %arg6_1 : Tensor "i64[s37, 1][1, 1]cuda:0" = PlaceHolder[target=arg6_1] +# %view_1 : Tensor "f32[s0, 1][1, 1]cuda:0"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg3_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %gather : Tensor "i64[s0, 1][1, 1]cuda:0"[num_users=1] = call_function[target=torch.ops.aten.gather.default](args = (%arg6_1, 1, %getitem_1), kwargs = {}) +# return %gather +triton_poi_fused_gather_max_view_1 = async_compile.triton('triton_poi_fused_gather_max_view_1', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 2}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=0, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_gather_max_view_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 12}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_gather_max_view_1(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tl.store(out_ptr0 + (x0), tmp0, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/ki/ckijd3g3dwsrqk5o3zjxohkv32tjipmuudawexakd3g2v5jm5qh4.py +# Topologically Sorted Source Nodes: [flatten, max_1, flat_cs, floordiv, batch_offsets, repeat_interleave, selected_input_index, hidden_states], Original ATen: [aten.view, aten.max, aten.floor_divide, aten.arange, aten.unsqueeze, aten.add, aten.index] +# Source node to ATen node mapping: +# batch_offsets => iota +# flat_cs => view_4 +# flatten => view_1 +# floordiv => div +# hidden_states => index +# max_1 => max_1 +# repeat_interleave => unsqueeze_1, view_5 +# selected_input_index => add_47 +# Graph fragment: +# %arg8_1 : Tensor "bf16[s0, s87][s87, 1]cuda:0" = PlaceHolder[target=arg8_1] +# %view_1 : Tensor "f32[s0, 1][1, 1]cuda:0"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg3_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %view_4 : Tensor "i64[s0][1]cuda:0"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%getitem_1, [%arg3_1]), kwargs = {}) +# %div : Tensor "i64[s0][1]cuda:0"[num_users=1] = call_function[target=torch.ops.aten.div.Tensor_mode](args = (%view_4, 1), kwargs = {rounding_mode: floor}) +# %iota : Tensor "i64[s0][1]cuda:0"[num_users=1] = call_function[target=torch.ops.prims.iota.default](args = (%arg3_1,), kwargs = {start: 0, step: 1, dtype: torch.int64, device: cuda:0, requires_grad: False}) +# %unsqueeze_1 : Tensor "i64[s0, 1][1, 1]cuda:0"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%iota, 1), kwargs = {}) +# %view_5 : Tensor "i64[s0][1]cuda:0"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%expand, [%arg3_1]), kwargs = {}) +# %add_47 : Tensor "i64[s0][1]cuda:0"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%div, %view_5), kwargs = {}) +# %index : Tensor "bf16[s0, s87][s87, 1]cuda:0"[num_users=1] = call_function[target=torch.ops.aten.index.Tensor](args = (%arg8_1, [%add_47]), kwargs = {}) +# return %index +triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2 = async_compile.triton('triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 16384}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*bf16', 'out_ptr0': '*bf16', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=0, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 73728}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x2 = xindex + tmp0 = tl.load(in_ptr0 + (x2), xmask, eviction_policy='evict_last').to(tl.float32) + tl.store(out_ptr0 + (x2), tmp0, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/ch/cchdj77jkafr4nkztheaodplwx6i4iwh4fb5clcqsavtgm5lj27t.py +# Topologically Sorted Source Nodes: [flatten, max_1, add_2], Original ATen: [aten.view, aten.max, aten.add] +# Source node to ATen node mapping: +# add_2 => add_53 +# flatten => view_1 +# max_1 => max_1 +# Graph fragment: +# %view_1 : Tensor "f32[s0, 1][1, 1]cuda:0"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg3_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %add_53 : Tensor "i64[s0, 1][1, 1]cuda:0"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%getitem_1, %arg9_1), kwargs = {}) +# return %add_53 +triton_poi_fused_add_max_view_3 = async_compile.triton('triton_poi_fused_add_max_view_3', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 2}, + filename=__file__, + triton_meta={'signature': {'out_ptr0': '*i64', 'ks0': 'i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=0, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_max_view_3', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 0, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 8}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_max_view_3(out_ptr0, ks0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = ks0 + tl.store(out_ptr0 + (x0), tmp0, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1, arg7_1, arg8_1, arg9_1 = args + args.clear() + s53 = arg0_1 + s68 = arg1_1 + s0 = arg3_1 + s37 = arg5_1 + s87 = arg7_1 + s77 = arg9_1 + assert_size_stride(arg2_1, (s0, 1), (1, 1)) + assert_size_stride(arg4_1, (s0, 1), (1, 1)) + assert_size_stride(arg6_1, (s37, 1), (1, 1)) + assert_size_stride(arg8_1, (s0, s87), (s87, 1)) + with torch.cuda._DeviceGuard(0): + torch.cuda.set_device(0) + buf0 = empty_strided_cuda((s0, 1, 1), (1, 1, 1), torch.float32) + buf1 = empty_strided_cuda((s0, 1), (1, 1), torch.float32) + # Topologically Sorted Source Nodes: [unsqueeze, view, expand_scores, flatten, max_1], Original ATen: [aten.unsqueeze, aten.view, aten.mul, aten.max] + stream0 = get_raw_stream(0) + triton_poi_fused_max_mul_unsqueeze_view_0.run(arg2_1, arg4_1, buf0, buf1, s0, stream=stream0) + del arg2_1 + del arg4_1 + buf2 = empty_strided_cuda((s0, 1), (1, 1), torch.int64) + # Topologically Sorted Source Nodes: [flatten, max_1, gather], Original ATen: [aten.view, aten.max, aten.gather] + stream0 = get_raw_stream(0) + triton_poi_fused_gather_max_view_1.run(arg6_1, buf2, s0, stream=stream0) + buf3 = empty_strided_cuda((s0, s87), (s87, 1), torch.bfloat16) + # Topologically Sorted Source Nodes: [flatten, max_1, flat_cs, floordiv, batch_offsets, repeat_interleave, selected_input_index, hidden_states], Original ATen: [aten.view, aten.max, aten.floor_divide, aten.arange, aten.unsqueeze, aten.add, aten.index] + triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2_xnumel = s0*s87 + stream0 = get_raw_stream(0) + triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2.run(arg8_1, buf3, triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2_xnumel, stream=stream0) + del arg8_1 + buf4 = empty_strided_cuda((s0, 1), (1, 1), torch.int64) + # Topologically Sorted Source Nodes: [flatten, max_1, add_2], Original ATen: [aten.view, aten.max, aten.add] + stream0 = get_raw_stream(0) + triton_poi_fused_add_max_view_3.run(buf4, s77, s0, stream=stream0) + return (reinterpret_tensor(buf2, (s0, ), (1, ), 0), buf3, buf1, buf0, arg6_1, buf4, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = 1 + arg1_1 = 2 + arg2_1 = rand_strided((2, 1), (1, 1), device='cuda:0', dtype=torch.float32) + arg3_1 = 2 + arg4_1 = rand_strided((2, 1), (1, 1), device='cuda:0', dtype=torch.float32) + arg5_1 = 2 + arg6_1 = rand_strided((2, 1), (1, 1), device='cuda:0', dtype=torch.int64) + arg7_1 = 6144 + arg8_1 = rand_strided((2, 6144), (6144, 1), device='cuda:0', dtype=torch.bfloat16) + arg9_1 = 1 + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1, arg7_1, arg8_1, arg9_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/l7/cl7jhv4e2cmi7pt4ong3bvjbvcginh2k5ayjyzuhsllntj5t4ibw.py b/.inductor_cache/l7/cl7jhv4e2cmi7pt4ong3bvjbvcginh2k5ayjyzuhsllntj5t4ibw.py new file mode 100644 index 0000000000000000000000000000000000000000..bba310c29b4b301d7e62eb6c03a2ef3c143a65e6 --- /dev/null +++ b/.inductor_cache/l7/cl7jhv4e2cmi7pt4ong3bvjbvcginh2k5ayjyzuhsllntj5t4ibw.py @@ -0,0 +1,142 @@ +# AOT ID: ['5_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/bs/cbsoghspbphq6mjn2zcqfdcax42m3a5siu3evh5xfqpdxn6sm6t6.py +# Topologically Sorted Source Nodes: [unsqueeze, mul], Original ATen: [aten.unsqueeze, aten.mul] +# Source node to ATen node mapping: +# mul => mul_2 +# unsqueeze => unsqueeze +# Graph fragment: +# %arg2_1 : Tensor "f32[s0, s3][s3, 1]cuda:4" = PlaceHolder[target=arg2_1] +# %arg3_1 : Tensor "f32[s0, s3, 1][s3, 1, 1]cuda:4" = PlaceHolder[target=arg3_1] +# %arg4_1 : Tensor "f64[][]cpu" = PlaceHolder[target=arg4_1] +# %unsqueeze : Tensor "f32[s0, s3, 1][s3, 1, 1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%arg2_1, -1), kwargs = {}) +# %mul_2 : Tensor "f32[s0, s3, 1][s3, 1, 1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%unsqueeze, %arg3_1), kwargs = {}) +# %convert_element_type_default_1 : Tensor "f32[][]cpu"[num_users=1] = call_function[target=torch.ops.prims.convert_element_type.default](args = (%arg4_1, torch.float32), kwargs = {}) +# %mul_tensor : Tensor "f32[s0, s3, 1][s3, 1, 1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mul_2, %convert_element_type_default_1), kwargs = {}) +# return %mul_tensor +triton_poi_fused_mul_unsqueeze_0 = async_compile.triton('triton_poi_fused_mul_unsqueeze_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 256}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'in_ptr2': 'fp64', 'out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=4, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_unsqueeze_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 3, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 4096}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_unsqueeze_0(in_ptr0, in_ptr1, in_ptr2, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp3 = in_ptr2 + tmp2 = tmp0 * tmp1 + tmp4 = tmp3.to(tl.float32) + tmp5 = tmp2 * tmp4 + tl.store(out_ptr0 + (x0), tmp5, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1 = args + args.clear() + s7 = arg0_1 + s3 = arg1_1 + arg2_1_size = arg2_1.size() + s0 = arg2_1_size[0] + assert_size_stride(arg2_1, (s0, s3), (s3, 1)) + assert_size_stride(arg3_1, (s0, s3, 1), (s3, 1, 1)) + assert_size_stride(arg4_1, (), ()) + with torch.cuda._DeviceGuard(4): + torch.cuda.set_device(4) + buf0 = empty_strided_cuda((s0, s3, 1), (s3, 1, 1), torch.float32) + # Topologically Sorted Source Nodes: [unsqueeze, mul], Original ATen: [aten.unsqueeze, aten.mul] + triton_poi_fused_mul_unsqueeze_0_xnumel = s0*s3 + stream4 = get_raw_stream(4) + triton_poi_fused_mul_unsqueeze_0.run(arg2_1, arg3_1, arg4_1.item(), buf0, triton_poi_fused_mul_unsqueeze_0_xnumel, stream=stream4) + del arg2_1 + del arg3_1 + del arg4_1 + return (buf0, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = 8 + arg1_1 = 32 + arg2_1 = rand_strided((8, 32), (32, 1), device='cuda:4', dtype=torch.float32) + arg3_1 = rand_strided((8, 32, 1), (32, 1, 1), device='cuda:4', dtype=torch.float32) + arg4_1 = rand_strided((), (), device='cpu', dtype=torch.float64) + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/la/claldzplizwfwkcjty6ddw7gqqur77xycf4hw5y5ep3rzmu3rd2p.py b/.inductor_cache/la/claldzplizwfwkcjty6ddw7gqqur77xycf4hw5y5ep3rzmu3rd2p.py new file mode 100644 index 0000000000000000000000000000000000000000..fc1b4587e6c7f17a828c01225e3c1cd537235ccc --- /dev/null +++ b/.inductor_cache/la/claldzplizwfwkcjty6ddw7gqqur77xycf4hw5y5ep3rzmu3rd2p.py @@ -0,0 +1,27 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 2}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'out_ptr0': '*fp32', 'out_ptr1': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=5, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_max_mul_unsqueeze_view_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 2, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 12}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_max_mul_unsqueeze_view_0(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp2 = tmp0 * tmp1 + tl.store(out_ptr0 + (x0), tmp2, xmask) + tl.store(out_ptr1 + (x0), tmp2, xmask) diff --git a/.inductor_cache/lc/clcguzeiji37jwgntus444hj3afycp43fm5qx53rkl6toz6ywxve.py b/.inductor_cache/lc/clcguzeiji37jwgntus444hj3afycp43fm5qx53rkl6toz6ywxve.py new file mode 100644 index 0000000000000000000000000000000000000000..dda964456fa2be20b77a53353e5be17b9a643c28 --- /dev/null +++ b/.inductor_cache/lc/clcguzeiji37jwgntus444hj3afycp43fm5qx53rkl6toz6ywxve.py @@ -0,0 +1,46 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 128}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'out_ptr1': '*i1', 'ks0': 'i64', 'ks1': 'i64', 'ks2': 'i64', 'ks3': 'i64', 'ks4': 'i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=2, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_bitwise_and_bitwise_not_bitwise_or_ge_lt_mul_sub_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 2912}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_bitwise_and_bitwise_not_bitwise_or_ge_lt_mul_sub_0(in_ptr0, out_ptr0, out_ptr1, ks0, ks1, ks2, ks3, ks4, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = ks0 + tmp2 = tmp0 >= tmp1 + tmp3 = ks1 + tmp4 = tmp0 < tmp3 + tmp5 = tmp2 & tmp4 + tmp6 = ks2 + tmp7 = tmp0 >= tmp6 + tmp8 = ks3 + tmp9 = tmp0 < tmp8 + tmp10 = tmp7 & tmp9 + tmp11 = tmp5 | tmp10 + tmp12 = tmp11.to(tl.int64) + tmp13 = tmp5.to(tl.int64) + tmp14 = tmp13 * tmp1 + tmp15 = tmp10.to(tl.int64) + tmp16 = ks0 + ks2 + ((-1)*ks1) + ((-1)*ks4) + tmp17 = tmp15 * tmp16 + tmp18 = tmp14 + tmp17 + tmp19 = tmp0 - tmp18 + tmp20 = tmp12 * tmp19 + tmp21 = tmp11 == 0 + tl.store(out_ptr0 + (x0), tmp20, xmask) + tl.store(out_ptr1 + (x0), tmp21, xmask) diff --git a/.inductor_cache/le/clecjasaoxytit2li7xxctyurhei5imp4ctbhvgv745nfl7pmfne.py b/.inductor_cache/le/clecjasaoxytit2li7xxctyurhei5imp4ctbhvgv745nfl7pmfne.py new file mode 100644 index 0000000000000000000000000000000000000000..e07ba522e8ef3b6d50fc8809e2e95d87ba668872 --- /dev/null +++ b/.inductor_cache/le/clecjasaoxytit2li7xxctyurhei5imp4ctbhvgv745nfl7pmfne.py @@ -0,0 +1,237 @@ +# AOT ID: ['8_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/vv/cvvp5qtrcvkzdmujfntpzyjmtsstafxvfpnsgkle2jjcnsg6ojzg.py +# Topologically Sorted Source Nodes: [ge, lt, org_vocab_mask, ge_1, lt_1, added_vocab_mask, vocab_mask, mul, mul_1, valid_offset, sub_3, input_], Original ATen: [aten.ge, aten.lt, aten.bitwise_and, aten.bitwise_or, aten.mul, aten.add, aten.sub] +# Source node to ATen node mapping: +# added_vocab_mask => bitwise_and_1 +# ge => ge +# ge_1 => ge_1 +# input_ => mul_2 +# lt => lt +# lt_1 => lt_1 +# mul => mul +# mul_1 => mul_1 +# org_vocab_mask => bitwise_and +# sub_3 => sub_3 +# valid_offset => add +# vocab_mask => bitwise_or +# Graph fragment: +# %arg0_1 : Tensor "i64[1][1]cuda:0" = PlaceHolder[target=arg0_1] +# %ge : Tensor "b8[1][1]cuda:0"[num_users=1] = call_function[target=torch.ops.aten.ge.Scalar](args = (%arg0_1, %arg1_1), kwargs = {}) +# %lt : Tensor "b8[1][1]cuda:0"[num_users=1] = call_function[target=torch.ops.aten.lt.Scalar](args = (%arg0_1, %arg2_1), kwargs = {}) +# %bitwise_and : Tensor "b8[1][1]cuda:0"[num_users=2] = call_function[target=torch.ops.aten.bitwise_and.Tensor](args = (%ge, %lt), kwargs = {}) +# %ge_1 : Tensor "b8[1][1]cuda:0"[num_users=1] = call_function[target=torch.ops.aten.ge.Scalar](args = (%arg0_1, %arg3_1), kwargs = {}) +# %lt_1 : Tensor "b8[1][1]cuda:0"[num_users=1] = call_function[target=torch.ops.aten.lt.Scalar](args = (%arg0_1, %arg4_1), kwargs = {}) +# %bitwise_and_1 : Tensor "b8[1][1]cuda:0"[num_users=2] = call_function[target=torch.ops.aten.bitwise_and.Tensor](args = (%ge_1, %lt_1), kwargs = {}) +# %bitwise_or : Tensor "b8[1][1]cuda:0"[num_users=2] = call_function[target=torch.ops.aten.bitwise_or.Tensor](args = (%bitwise_and, %bitwise_and_1), kwargs = {}) +# %mul : Tensor "i64[1][1]cuda:0"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%bitwise_and, %arg1_1), kwargs = {}) +# %mul_1 : Tensor "i64[1][1]cuda:0"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%bitwise_and_1, %sub_2), kwargs = {}) +# %add : Tensor "i64[1][1]cuda:0"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%mul, %mul_1), kwargs = {}) +# %sub_3 : Tensor "i64[1][1]cuda:0"[num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%arg0_1, %add), kwargs = {}) +# %mul_2 : Tensor "i64[1][1]cuda:0"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%bitwise_or, %sub_3), kwargs = {}) +# return %mul_2 +triton_poi_fused_add_bitwise_and_bitwise_or_ge_lt_mul_sub_0 = async_compile.triton('triton_poi_fused_add_bitwise_and_bitwise_or_ge_lt_mul_sub_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'ks0': 'i64', 'ks1': 'i64', 'ks2': 'i64', 'ks3': 'i64', 'ks4': 'i64', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=0, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_bitwise_and_bitwise_or_ge_lt_mul_sub_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_bitwise_and_bitwise_or_ge_lt_mul_sub_0(in_ptr0, out_ptr0, ks0, ks1, ks2, ks3, ks4, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = tl.load(in_ptr0 + (0)) + tmp1 = tl.broadcast_to(tmp0, [XBLOCK]) + tmp2 = ks0 + tmp3 = tmp1 >= tmp2 + tmp4 = ks1 + tmp5 = tmp1 < tmp4 + tmp6 = tmp3 & tmp5 + tmp7 = ks2 + tmp8 = tmp1 >= tmp7 + tmp9 = ks3 + tmp10 = tmp1 < tmp9 + tmp11 = tmp8 & tmp10 + tmp12 = tmp6 | tmp11 + tmp13 = tmp12.to(tl.int64) + tmp14 = tmp6.to(tl.int64) + tmp15 = tmp14 * tmp2 + tmp16 = tmp11.to(tl.int64) + tmp17 = ks0 + ks2 + ((-1)*ks1) + ((-1)*ks4) + tmp18 = tmp16 * tmp17 + tmp19 = tmp15 + tmp18 + tmp20 = tmp1 - tmp19 + tmp21 = tmp13 * tmp20 + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp21, None) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/mw/cmwo3oplzoxl3jmuphuwdb37kx5ted543eswidxdktdu3ofpcndz.py +# Topologically Sorted Source Nodes: [ge, lt, org_vocab_mask, ge_1, lt_1, added_vocab_mask, vocab_mask, invert], Original ATen: [aten.ge, aten.lt, aten.bitwise_and, aten.bitwise_or, aten.bitwise_not] +# Source node to ATen node mapping: +# added_vocab_mask => bitwise_and_1 +# ge => ge +# ge_1 => ge_1 +# invert => bitwise_not +# lt => lt +# lt_1 => lt_1 +# org_vocab_mask => bitwise_and +# vocab_mask => bitwise_or +# Graph fragment: +# %arg0_1 : Tensor "i64[1][1]cuda:0" = PlaceHolder[target=arg0_1] +# %ge : Tensor "b8[1][1]cuda:0"[num_users=1] = call_function[target=torch.ops.aten.ge.Scalar](args = (%arg0_1, %arg1_1), kwargs = {}) +# %lt : Tensor "b8[1][1]cuda:0"[num_users=1] = call_function[target=torch.ops.aten.lt.Scalar](args = (%arg0_1, %arg2_1), kwargs = {}) +# %bitwise_and : Tensor "b8[1][1]cuda:0"[num_users=2] = call_function[target=torch.ops.aten.bitwise_and.Tensor](args = (%ge, %lt), kwargs = {}) +# %ge_1 : Tensor "b8[1][1]cuda:0"[num_users=1] = call_function[target=torch.ops.aten.ge.Scalar](args = (%arg0_1, %arg3_1), kwargs = {}) +# %lt_1 : Tensor "b8[1][1]cuda:0"[num_users=1] = call_function[target=torch.ops.aten.lt.Scalar](args = (%arg0_1, %arg4_1), kwargs = {}) +# %bitwise_and_1 : Tensor "b8[1][1]cuda:0"[num_users=2] = call_function[target=torch.ops.aten.bitwise_and.Tensor](args = (%ge_1, %lt_1), kwargs = {}) +# %bitwise_or : Tensor "b8[1][1]cuda:0"[num_users=2] = call_function[target=torch.ops.aten.bitwise_or.Tensor](args = (%bitwise_and, %bitwise_and_1), kwargs = {}) +# %bitwise_not : Tensor "b8[1][1]cuda:0"[num_users=1] = call_function[target=torch.ops.aten.bitwise_not.default](args = (%bitwise_or,), kwargs = {}) +# return %bitwise_not +triton_poi_fused_bitwise_and_bitwise_not_bitwise_or_ge_lt_1 = async_compile.triton('triton_poi_fused_bitwise_and_bitwise_not_bitwise_or_ge_lt_1', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i1', 'ks0': 'i64', 'ks1': 'i64', 'ks2': 'i64', 'ks3': 'i64', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=0, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_bitwise_and_bitwise_not_bitwise_or_ge_lt_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_bitwise_and_bitwise_not_bitwise_or_ge_lt_1(in_ptr0, out_ptr0, ks0, ks1, ks2, ks3, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = tl.load(in_ptr0 + (0)) + tmp1 = tl.broadcast_to(tmp0, [XBLOCK]) + tmp2 = ks0 + tmp3 = tmp1 >= tmp2 + tmp4 = ks1 + tmp5 = tmp1 < tmp4 + tmp6 = tmp3 & tmp5 + tmp7 = ks2 + tmp8 = tmp1 >= tmp7 + tmp9 = ks3 + tmp10 = tmp1 < tmp9 + tmp11 = tmp8 & tmp10 + tmp12 = tmp6 | tmp11 + tmp13 = tmp12 == 0 + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp13, None) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1 = args + args.clear() + s90 = arg1_1 + s87 = arg2_1 + s68 = arg3_1 + s53 = arg4_1 + s88 = arg5_1 + assert_size_stride(arg0_1, (1, ), (1, )) + with torch.cuda._DeviceGuard(0): + torch.cuda.set_device(0) + buf0 = empty_strided_cuda((1, ), (1, ), torch.int64) + # Topologically Sorted Source Nodes: [ge, lt, org_vocab_mask, ge_1, lt_1, added_vocab_mask, vocab_mask, mul, mul_1, valid_offset, sub_3, input_], Original ATen: [aten.ge, aten.lt, aten.bitwise_and, aten.bitwise_or, aten.mul, aten.add, aten.sub] + stream0 = get_raw_stream(0) + triton_poi_fused_add_bitwise_and_bitwise_or_ge_lt_mul_sub_0.run(arg0_1, buf0, s90, s87, s68, s53, s88, 1, stream=stream0) + buf1 = empty_strided_cuda((1, ), (1, ), torch.bool) + # Topologically Sorted Source Nodes: [ge, lt, org_vocab_mask, ge_1, lt_1, added_vocab_mask, vocab_mask, invert], Original ATen: [aten.ge, aten.lt, aten.bitwise_and, aten.bitwise_or, aten.bitwise_not] + stream0 = get_raw_stream(0) + triton_poi_fused_bitwise_and_bitwise_not_bitwise_or_ge_lt_1.run(arg0_1, buf1, s90, s87, s68, s53, 1, stream=stream0) + del arg0_1 + return (buf0, buf1, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = rand_strided((1, ), (1, ), device='cuda:0', dtype=torch.int64) + arg1_1 = 0 + arg2_1 = 19360 + arg3_1 = 154880 + arg4_1 = 154880 + arg5_1 = 0 + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/lj/05d8f65a9e46aad613d2a081040250ab394bc70635bf034048104fdbc41ddd13.best_config b/.inductor_cache/lj/05d8f65a9e46aad613d2a081040250ab394bc70635bf034048104fdbc41ddd13.best_config new file mode 100644 index 0000000000000000000000000000000000000000..2e92390d49dfefc4875446fab6de61635109ee3c --- /dev/null +++ b/.inductor_cache/lj/05d8f65a9e46aad613d2a081040250ab394bc70635bf034048104fdbc41ddd13.best_config @@ -0,0 +1 @@ +{"XBLOCK": 128, "num_warps": 4, "num_stages": 1, "configs_hash": "1b2cc4dbebb9680d3ce31843331593b159e4046c056f195ca1ccf2464d5b37d1", "found_by_coordesc": false, "time_taken_ms": 32, "triton_cache_hash": "JO6EURS6OPPIJNQKRKLRTFGE6YEGGS4IKHEPZFQNLCS72U34VJOQ"} \ No newline at end of file diff --git a/.inductor_cache/lj/cljqnweqtkyp3ilstged43ibhg2lyswdikllklg47guwqhlww37r.py b/.inductor_cache/lj/cljqnweqtkyp3ilstged43ibhg2lyswdikllklg47guwqhlww37r.py new file mode 100644 index 0000000000000000000000000000000000000000..18bcd54c3e867381e6486ff30eaa2225b551107a --- /dev/null +++ b/.inductor_cache/lj/cljqnweqtkyp3ilstged43ibhg2lyswdikllklg47guwqhlww37r.py @@ -0,0 +1,24 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8192}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*bf16', 'out_ptr0': '*bf16', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=2, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 36864}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask).to(tl.float32) + tl.store(out_ptr0 + (x0), tmp0, xmask) diff --git a/.inductor_cache/lo/cloair755wstllnpsaikfldc3fczoun4sma5ht3d3uh7t2rjby22.py b/.inductor_cache/lo/cloair755wstllnpsaikfldc3fczoun4sma5ht3d3uh7t2rjby22.py new file mode 100644 index 0000000000000000000000000000000000000000..c21b897afd7b3ee639a047dc71404e776ee748be --- /dev/null +++ b/.inductor_cache/lo/cloair755wstllnpsaikfldc3fczoun4sma5ht3d3uh7t2rjby22.py @@ -0,0 +1,137 @@ +# AOT ID: ['10_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/sf/csf3zztedhp5ggivmb2xxjvsf6g2j6norsgunvnqoyvmusjr3cse.py +# Topologically Sorted Source Nodes: [unsqueeze, mul], Original ATen: [aten.unsqueeze, aten.mul] +# Source node to ATen node mapping: +# mul => mul_2 +# unsqueeze => unsqueeze +# Graph fragment: +# %arg1_1 : Tensor "f32[1, s3][s3, 1]cuda:7" = PlaceHolder[target=arg1_1] +# %arg2_1 : Tensor "f32[1, s3, 1][s3, 1, 1]cuda:7" = PlaceHolder[target=arg2_1] +# %arg3_1 : Tensor "f64[][]cpu" = PlaceHolder[target=arg3_1] +# %unsqueeze : Tensor "f32[1, s3, 1][s3, 1, 1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%arg1_1, -1), kwargs = {}) +# %mul_2 : Tensor "f32[1, s3, 1][s3, 1, 1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%unsqueeze, %arg2_1), kwargs = {}) +# %convert_element_type_default_1 : Tensor "f32[][]cpu"[num_users=1] = call_function[target=torch.ops.prims.convert_element_type.default](args = (%arg3_1, torch.float32), kwargs = {}) +# %mul_tensor : Tensor "f32[1, s3, 1][s3, 1, 1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mul_2, %convert_element_type_default_1), kwargs = {}) +# return %mul_tensor +triton_poi_fused_mul_unsqueeze_0 = async_compile.triton('triton_poi_fused_mul_unsqueeze_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 32}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'in_ptr2': 'fp64', 'out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=7, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_unsqueeze_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 3, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 512}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_unsqueeze_0(in_ptr0, in_ptr1, in_ptr2, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp3 = in_ptr2 + tmp2 = tmp0 * tmp1 + tmp4 = tmp3.to(tl.float32) + tmp5 = tmp2 * tmp4 + tl.store(out_ptr0 + (x0), tmp5, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1 = args + args.clear() + s3 = arg0_1 + assert_size_stride(arg1_1, (1, s3), (s3, 1)) + assert_size_stride(arg2_1, (1, s3, 1), (s3, 1, 1)) + assert_size_stride(arg3_1, (), ()) + with torch.cuda._DeviceGuard(7): + torch.cuda.set_device(7) + buf0 = empty_strided_cuda((1, s3, 1), (s3, 1, 1), torch.float32) + # Topologically Sorted Source Nodes: [unsqueeze, mul], Original ATen: [aten.unsqueeze, aten.mul] + stream7 = get_raw_stream(7) + triton_poi_fused_mul_unsqueeze_0.run(arg1_1, arg2_1, arg3_1.item(), buf0, s3, stream=stream7) + del arg1_1 + del arg2_1 + del arg3_1 + return (buf0, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = 32 + arg1_1 = rand_strided((1, 32), (32, 1), device='cuda:7', dtype=torch.float32) + arg2_1 = rand_strided((1, 32, 1), (32, 1, 1), device='cuda:7', dtype=torch.float32) + arg3_1 = rand_strided((), (), device='cpu', dtype=torch.float64) + return [arg0_1, arg1_1, arg2_1, arg3_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/lo/clovmdykn5vbwv6t46qzh56oikabazsc5m3deqb7gic2eq2lksnj.py b/.inductor_cache/lo/clovmdykn5vbwv6t46qzh56oikabazsc5m3deqb7gic2eq2lksnj.py new file mode 100644 index 0000000000000000000000000000000000000000..a403d5e9ff188d9db1eef6999410de544edf15dc --- /dev/null +++ b/.inductor_cache/lo/clovmdykn5vbwv6t46qzh56oikabazsc5m3deqb7gic2eq2lksnj.py @@ -0,0 +1,29 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 32}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'in_ptr2': 'fp64', 'out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=2, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_unsqueeze_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 3, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 512}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_unsqueeze_0(in_ptr0, in_ptr1, in_ptr2, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp3 = in_ptr2 + tmp2 = tmp0 * tmp1 + tmp4 = tmp3.to(tl.float32) + tmp5 = tmp2 * tmp4 + tl.store(out_ptr0 + (x0), tmp5, xmask) diff --git a/.inductor_cache/ls/clsiben2w5lcnbhgxdfctbonf7bwxklyzvowh7rxhjlmnmsj365j.py b/.inductor_cache/ls/clsiben2w5lcnbhgxdfctbonf7bwxklyzvowh7rxhjlmnmsj365j.py new file mode 100644 index 0000000000000000000000000000000000000000..c31ee32003e223fcb197aee751ee89db19116018 --- /dev/null +++ b/.inductor_cache/ls/clsiben2w5lcnbhgxdfctbonf7bwxklyzvowh7rxhjlmnmsj365j.py @@ -0,0 +1,24 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 65536}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*bf16', 'out_ptr0': '*bf16', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=4, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 294912}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x2 = xindex + tmp0 = tl.load(in_ptr0 + (x2), xmask, eviction_policy='evict_last').to(tl.float32) + tl.store(out_ptr0 + (x2), tmp0, xmask) diff --git a/.inductor_cache/ls/f7afec1a952a8dc7b96869ab7e02b4c9d1910bf4756f42f49cec71354f1b677f.best_config b/.inductor_cache/ls/f7afec1a952a8dc7b96869ab7e02b4c9d1910bf4756f42f49cec71354f1b677f.best_config new file mode 100644 index 0000000000000000000000000000000000000000..f523c8ace74d4450540cc45fcdd06a3b9e2dcf68 --- /dev/null +++ b/.inductor_cache/ls/f7afec1a952a8dc7b96869ab7e02b4c9d1910bf4756f42f49cec71354f1b677f.best_config @@ -0,0 +1 @@ +{"XBLOCK": 256, "num_warps": 4, "num_stages": 1, "configs_hash": "7cced77f371acaa5aa7d90332a90e0c907727cfefb71d9cc9d997c24557fc44f", "found_by_coordesc": false, "time_taken_ms": 22, "triton_cache_hash": "QLXJTPJWIG7LHGEN76P7EYFUJIJLXLDECRO3I6NRHSQ4NBZC2KMA"} \ No newline at end of file diff --git a/.inductor_cache/lu/038fa38ae570132291956feaf38ee5e0b0453322f5eae78588849d9c0e8ee110.best_config b/.inductor_cache/lu/038fa38ae570132291956feaf38ee5e0b0453322f5eae78588849d9c0e8ee110.best_config new file mode 100644 index 0000000000000000000000000000000000000000..249a60133defa60a43c1d19e9569ef7f0c94e215 --- /dev/null +++ b/.inductor_cache/lu/038fa38ae570132291956feaf38ee5e0b0453322f5eae78588849d9c0e8ee110.best_config @@ -0,0 +1 @@ +{"XBLOCK": 128, "num_warps": 4, "num_stages": 1, "configs_hash": "1b2cc4dbebb9680d3ce31843331593b159e4046c056f195ca1ccf2464d5b37d1", "found_by_coordesc": false, "time_taken_ms": 23, "triton_cache_hash": "JO6EURS6OPPIJNQKRKLRTFGE6YEGGS4IKHEPZFQNLCS72U34VJOQ"} \ No newline at end of file diff --git a/.inductor_cache/lu/clusdog254vskw2a4djnisaycdvehl2ce7mwvswzfsuvv3v4lxx2.py b/.inductor_cache/lu/clusdog254vskw2a4djnisaycdvehl2ce7mwvswzfsuvv3v4lxx2.py new file mode 100644 index 0000000000000000000000000000000000000000..9ab13f1af841f83b5a4971b8ee8e345d4379dce1 --- /dev/null +++ b/.inductor_cache/lu/clusdog254vskw2a4djnisaycdvehl2ce7mwvswzfsuvv3v4lxx2.py @@ -0,0 +1,24 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8192}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*bf16', 'out_ptr0': '*bf16', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=0, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 36864}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask).to(tl.float32) + tl.store(out_ptr0 + (x0), tmp0, xmask) diff --git a/.inductor_cache/ly/clyk2qeu2sbqqf2amv7vlswqxu34tqu4vendvlblzlrakivgqx6s.py b/.inductor_cache/ly/clyk2qeu2sbqqf2amv7vlswqxu34tqu4vendvlblzlrakivgqx6s.py new file mode 100644 index 0000000000000000000000000000000000000000..8e4ebc1b24dd9a93b26da416e545aabb29568c09 --- /dev/null +++ b/.inductor_cache/ly/clyk2qeu2sbqqf2amv7vlswqxu34tqu4vendvlblzlrakivgqx6s.py @@ -0,0 +1,289 @@ +# AOT ID: ['11_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/rh/crhobtntezworhsvclhlo6xgjhdivblb7dtyucd6q6n3qtghp525.py +# Topologically Sorted Source Nodes: [unsqueeze, view, expand_scores, flatten, max_1], Original ATen: [aten.unsqueeze, aten.view, aten.mul, aten.max] +# Source node to ATen node mapping: +# expand_scores => mul_1 +# flatten => view_1 +# max_1 => getitem, max_1 +# unsqueeze => unsqueeze +# view => view +# Graph fragment: +# %arg1_1 : Tensor "f32[1, 1][1, 1]cuda:6" = PlaceHolder[target=arg1_1] +# %arg2_1 : Tensor "f32[1, 1][1, 1]cuda:6" = PlaceHolder[target=arg2_1] +# %mul_1 : Tensor "f32[1, 1, 1][1, 1, 1]cuda:6" = PlaceHolder[target=mul_1] +# %unsqueeze : Tensor "f32[1, 1, 1][1, 1, 1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%arg1_1, 2), kwargs = {}) +# %view : Tensor "f32[1, 1, 1][1, 1, 1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%arg2_1, [-1, 1, 1]), kwargs = {}) +# %mul_1 : Tensor "f32[1, 1, 1][1, 1, 1]cuda:6"[num_users=2] = call_function[target=torch.ops.aten.mul.Tensor](args = (%unsqueeze, %view), kwargs = {}) +# %view_1 : Tensor "f32[1, 1][1, 1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_1, [1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %getitem : Tensor "f32[1, 1][1, 1]cuda:6"[num_users=1] = call_function[target=operator.getitem](args = (%max_1, 0), kwargs = {}) +# return %mul_1,%getitem +triton_poi_fused_max_mul_unsqueeze_view_0 = async_compile.triton('triton_poi_fused_max_mul_unsqueeze_view_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'out_ptr0': '*fp32', 'out_ptr1': '*fp32', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=6, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_max_mul_unsqueeze_view_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 2, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_max_mul_unsqueeze_view_0(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = tl.load(in_ptr0 + (0)) + tmp1 = tl.broadcast_to(tmp0, [XBLOCK]) + tmp2 = tl.load(in_ptr1 + (0)) + tmp3 = tl.broadcast_to(tmp2, [XBLOCK]) + tmp4 = tmp1 * tmp3 + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp4, None) + tl.store(out_ptr1 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp4, None) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/jv/cjvqcxja6ql663g5qqhwdxypmfc3mpqhkof2i5mcdxy3zgvdfwoc.py +# Topologically Sorted Source Nodes: [flatten, max_1, gather], Original ATen: [aten.view, aten.max, aten.gather] +# Source node to ATen node mapping: +# flatten => view_1 +# gather => gather +# max_1 => max_1 +# Graph fragment: +# %arg3_1 : Tensor "i64[1, 1][1, 1]cuda:6" = PlaceHolder[target=arg3_1] +# %view_1 : Tensor "f32[1, 1][1, 1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_1, [1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %gather : Tensor "i64[1, 1][1, 1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.gather.default](args = (%arg3_1, 1, %getitem_1), kwargs = {}) +# return %gather +triton_poi_fused_gather_max_view_1 = async_compile.triton('triton_poi_fused_gather_max_view_1', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=6, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_gather_max_view_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_gather_max_view_1(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = tl.load(in_ptr0 + (0)) + tmp1 = tl.broadcast_to(tmp0, [XBLOCK]) + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp1, None) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/fi/cfif7q6mrsvb5g7ohbg7cc5eu7mghyn2by3awngtfg5ql2er6blx.py +# Topologically Sorted Source Nodes: [flatten, max_1, flat_cs, floordiv, batch_offsets, repeat_interleave, selected_input_index, hidden_states], Original ATen: [aten.view, aten.max, aten.floor_divide, aten.arange, aten.unsqueeze, aten.add, aten.index] +# Source node to ATen node mapping: +# batch_offsets => iota +# flat_cs => view_4 +# flatten => view_1 +# floordiv => div +# hidden_states => index +# max_1 => max_1 +# repeat_interleave => unsqueeze_1, view_5 +# selected_input_index => add +# Graph fragment: +# %arg5_1 : Tensor "bf16[1, s87][s87, 1]cuda:6" = PlaceHolder[target=arg5_1] +# %view_1 : Tensor "f32[1, 1][1, 1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_1, [1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %view_4 : Tensor "i64[1][1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%getitem_1, [1]), kwargs = {}) +# %div : Tensor "i64[1][1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.div.Tensor_mode](args = (%view_4, 1), kwargs = {rounding_mode: floor}) +# %iota : Tensor "i64[1][1]cuda:6"[num_users=1] = call_function[target=torch.ops.prims.iota.default](args = (1,), kwargs = {start: 0, step: 1, dtype: torch.int64, device: cuda:6, requires_grad: False}) +# %unsqueeze_1 : Tensor "i64[1, 1][1, 1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%iota, 1), kwargs = {}) +# %view_5 : Tensor "i64[1][1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%expand, [1]), kwargs = {}) +# %add : Tensor "i64[1][1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%div, %view_5), kwargs = {}) +# %index : Tensor "bf16[1, s87][s87, 1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.index.Tensor](args = (%arg5_1, [%add]), kwargs = {}) +# return %index +triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2 = async_compile.triton('triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8192}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*bf16', 'out_ptr0': '*bf16', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=6, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 36864}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask).to(tl.float32) + tl.store(out_ptr0 + (x0), tmp0, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/yt/cytkblpmxtiyttie4sb6q24fmxvz3keyhvpd7ohvwhco6atydhtq.py +# Topologically Sorted Source Nodes: [flatten, max_1, add_2], Original ATen: [aten.view, aten.max, aten.add] +# Source node to ATen node mapping: +# add_2 => add_3 +# flatten => view_1 +# max_1 => max_1 +# Graph fragment: +# %view_1 : Tensor "f32[1, 1][1, 1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_1, [1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %add_3 : Tensor "i64[1, 1][1, 1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%getitem_1, %arg6_1), kwargs = {}) +# return %add_3 +triton_poi_fused_add_max_view_3 = async_compile.triton('triton_poi_fused_add_max_view_3', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'out_ptr0': '*i64', 'ks0': 'i64', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=6, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_max_view_3', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 0, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_max_view_3(out_ptr0, ks0, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = ks0 + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32)), tmp0, None) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1 = args + args.clear() + s53 = arg0_1 + s87 = arg4_1 + s77 = arg6_1 + assert_size_stride(arg1_1, (1, 1), (1, 1)) + assert_size_stride(arg2_1, (1, 1), (1, 1)) + assert_size_stride(arg3_1, (1, 1), (1, 1)) + assert_size_stride(arg5_1, (1, s87), (s87, 1)) + with torch.cuda._DeviceGuard(6): + torch.cuda.set_device(6) + buf0 = empty_strided_cuda((1, 1, 1), (1, 1, 1), torch.float32) + buf1 = empty_strided_cuda((1, 1), (1, 1), torch.float32) + # Topologically Sorted Source Nodes: [unsqueeze, view, expand_scores, flatten, max_1], Original ATen: [aten.unsqueeze, aten.view, aten.mul, aten.max] + stream6 = get_raw_stream(6) + triton_poi_fused_max_mul_unsqueeze_view_0.run(arg1_1, arg2_1, buf0, buf1, 1, stream=stream6) + del arg1_1 + del arg2_1 + buf2 = empty_strided_cuda((1, 1), (1, 1), torch.int64) + # Topologically Sorted Source Nodes: [flatten, max_1, gather], Original ATen: [aten.view, aten.max, aten.gather] + stream6 = get_raw_stream(6) + triton_poi_fused_gather_max_view_1.run(arg3_1, buf2, 1, stream=stream6) + buf3 = empty_strided_cuda((1, s87), (s87, 1), torch.bfloat16) + # Topologically Sorted Source Nodes: [flatten, max_1, flat_cs, floordiv, batch_offsets, repeat_interleave, selected_input_index, hidden_states], Original ATen: [aten.view, aten.max, aten.floor_divide, aten.arange, aten.unsqueeze, aten.add, aten.index] + stream6 = get_raw_stream(6) + triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2.run(arg5_1, buf3, s87, stream=stream6) + del arg5_1 + buf4 = empty_strided_cuda((1, 1), (1, 1), torch.int64) + # Topologically Sorted Source Nodes: [flatten, max_1, add_2], Original ATen: [aten.view, aten.max, aten.add] + stream6 = get_raw_stream(6) + triton_poi_fused_add_max_view_3.run(buf4, s77, 1, stream=stream6) + return (reinterpret_tensor(buf2, (1, ), (1, ), 0), buf3, buf1, buf0, arg3_1, buf4, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = 1 + arg1_1 = rand_strided((1, 1), (1, 1), device='cuda:6', dtype=torch.float32) + arg2_1 = rand_strided((1, 1), (1, 1), device='cuda:6', dtype=torch.float32) + arg3_1 = rand_strided((1, 1), (1, 1), device='cuda:6', dtype=torch.int64) + arg4_1 = 6144 + arg5_1 = rand_strided((1, 6144), (6144, 1), device='cuda:6', dtype=torch.bfloat16) + arg6_1 = 1 + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/m2/cm2qb2bhq43a73ui4nbkj3emxogtfh77qsjmr742bhvxgi2ewqnb.py b/.inductor_cache/m2/cm2qb2bhq43a73ui4nbkj3emxogtfh77qsjmr742bhvxgi2ewqnb.py new file mode 100644 index 0000000000000000000000000000000000000000..6951f56b0fb42692d726a6b079a0a529bd416f13 --- /dev/null +++ b/.inductor_cache/m2/cm2qb2bhq43a73ui4nbkj3emxogtfh77qsjmr742bhvxgi2ewqnb.py @@ -0,0 +1,293 @@ +# AOT ID: ['13_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/bk/cbkfzqeg7hdufkppbhjnaeh6u3koghqsbszylqypgpg5j4upbw2x.py +# Topologically Sorted Source Nodes: [unsqueeze, view, expand_scores, flatten, max_1], Original ATen: [aten.unsqueeze, aten.view, aten.mul, aten.max] +# Source node to ATen node mapping: +# expand_scores => mul_3 +# flatten => view_1 +# max_1 => getitem, max_1 +# unsqueeze => unsqueeze +# view => view +# Graph fragment: +# %arg2_1 : Tensor "f32[s0, 1][1, 1]cuda:1" = PlaceHolder[target=arg2_1] +# %arg4_1 : Tensor "f32[s0, 1][1, 1]cuda:1" = PlaceHolder[target=arg4_1] +# %mul_3 : Tensor "f32[s0, 1, 1][1, 1, 1]cuda:1" = PlaceHolder[target=mul_3] +# %unsqueeze : Tensor "f32[s0, 1, 1][1, 1, 1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%arg2_1, 2), kwargs = {}) +# %view : Tensor "f32[s0, 1, 1][1, 1, 1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%arg4_1, [-1, 1, 1]), kwargs = {}) +# %mul_3 : Tensor "f32[s0, 1, 1][1, 1, 1]cuda:1"[num_users=2] = call_function[target=torch.ops.aten.mul.Tensor](args = (%unsqueeze, %view), kwargs = {}) +# %view_1 : Tensor "f32[s0, 1][1, 1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg3_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %getitem : Tensor "f32[s0, 1][1, 1]cuda:1"[num_users=1] = call_function[target=operator.getitem](args = (%max_1, 0), kwargs = {}) +# return %mul_3,%getitem +triton_poi_fused_max_mul_unsqueeze_view_0 = async_compile.triton('triton_poi_fused_max_mul_unsqueeze_view_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 2}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'out_ptr0': '*fp32', 'out_ptr1': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=1, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_max_mul_unsqueeze_view_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 2, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 12}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_max_mul_unsqueeze_view_0(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp2 = tmp0 * tmp1 + tl.store(out_ptr0 + (x0), tmp2, xmask) + tl.store(out_ptr1 + (x0), tmp2, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/6j/c6j7f2zfedgsifsvrtdzvprpzw6jujih2uwmzsjrvvfsrmkhcotk.py +# Topologically Sorted Source Nodes: [flatten, max_1, gather], Original ATen: [aten.view, aten.max, aten.gather] +# Source node to ATen node mapping: +# flatten => view_1 +# gather => gather +# max_1 => max_1 +# Graph fragment: +# %arg6_1 : Tensor "i64[s37, 1][1, 1]cuda:1" = PlaceHolder[target=arg6_1] +# %view_1 : Tensor "f32[s0, 1][1, 1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg3_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %gather : Tensor "i64[s0, 1][1, 1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.gather.default](args = (%arg6_1, 1, %getitem_1), kwargs = {}) +# return %gather +triton_poi_fused_gather_max_view_1 = async_compile.triton('triton_poi_fused_gather_max_view_1', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 2}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=1, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_gather_max_view_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 12}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_gather_max_view_1(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tl.store(out_ptr0 + (x0), tmp0, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/ah/cahr6j4k7wyazhocuhoqqgk6tbdzuuhv2ol4oih2nnegebuyza27.py +# Topologically Sorted Source Nodes: [flatten, max_1, flat_cs, floordiv, batch_offsets, repeat_interleave, selected_input_index, hidden_states], Original ATen: [aten.view, aten.max, aten.floor_divide, aten.arange, aten.unsqueeze, aten.add, aten.index] +# Source node to ATen node mapping: +# batch_offsets => iota +# flat_cs => view_4 +# flatten => view_1 +# floordiv => div +# hidden_states => index +# max_1 => max_1 +# repeat_interleave => unsqueeze_1, view_5 +# selected_input_index => add_47 +# Graph fragment: +# %arg8_1 : Tensor "bf16[s0, s87][s87, 1]cuda:1" = PlaceHolder[target=arg8_1] +# %view_1 : Tensor "f32[s0, 1][1, 1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg3_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %view_4 : Tensor "i64[s0][1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%getitem_1, [%arg3_1]), kwargs = {}) +# %div : Tensor "i64[s0][1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.div.Tensor_mode](args = (%view_4, 1), kwargs = {rounding_mode: floor}) +# %iota : Tensor "i64[s0][1]cuda:1"[num_users=1] = call_function[target=torch.ops.prims.iota.default](args = (%arg3_1,), kwargs = {start: 0, step: 1, dtype: torch.int64, device: cuda:1, requires_grad: False}) +# %unsqueeze_1 : Tensor "i64[s0, 1][1, 1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%iota, 1), kwargs = {}) +# %view_5 : Tensor "i64[s0][1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%expand, [%arg3_1]), kwargs = {}) +# %add_47 : Tensor "i64[s0][1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%div, %view_5), kwargs = {}) +# %index : Tensor "bf16[s0, s87][s87, 1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.index.Tensor](args = (%arg8_1, [%add_47]), kwargs = {}) +# return %index +triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2 = async_compile.triton('triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 16384}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*bf16', 'out_ptr0': '*bf16', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=1, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 73728}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x2 = xindex + tmp0 = tl.load(in_ptr0 + (x2), xmask, eviction_policy='evict_last').to(tl.float32) + tl.store(out_ptr0 + (x2), tmp0, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/hu/chumfn5dnh4divjblvadp4di35whjhi2ilih3kiyaam7agvrg2hf.py +# Topologically Sorted Source Nodes: [flatten, max_1, add_2], Original ATen: [aten.view, aten.max, aten.add] +# Source node to ATen node mapping: +# add_2 => add_53 +# flatten => view_1 +# max_1 => max_1 +# Graph fragment: +# %view_1 : Tensor "f32[s0, 1][1, 1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg3_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %add_53 : Tensor "i64[s0, 1][1, 1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%getitem_1, %arg9_1), kwargs = {}) +# return %add_53 +triton_poi_fused_add_max_view_3 = async_compile.triton('triton_poi_fused_add_max_view_3', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 2}, + filename=__file__, + triton_meta={'signature': {'out_ptr0': '*i64', 'ks0': 'i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=1, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_max_view_3', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 0, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 8}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_max_view_3(out_ptr0, ks0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = ks0 + tl.store(out_ptr0 + (x0), tmp0, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1, arg7_1, arg8_1, arg9_1 = args + args.clear() + s53 = arg0_1 + s68 = arg1_1 + s0 = arg3_1 + s37 = arg5_1 + s87 = arg7_1 + s77 = arg9_1 + assert_size_stride(arg2_1, (s0, 1), (1, 1)) + assert_size_stride(arg4_1, (s0, 1), (1, 1)) + assert_size_stride(arg6_1, (s37, 1), (1, 1)) + assert_size_stride(arg8_1, (s0, s87), (s87, 1)) + with torch.cuda._DeviceGuard(1): + torch.cuda.set_device(1) + buf0 = empty_strided_cuda((s0, 1, 1), (1, 1, 1), torch.float32) + buf1 = empty_strided_cuda((s0, 1), (1, 1), torch.float32) + # Topologically Sorted Source Nodes: [unsqueeze, view, expand_scores, flatten, max_1], Original ATen: [aten.unsqueeze, aten.view, aten.mul, aten.max] + stream1 = get_raw_stream(1) + triton_poi_fused_max_mul_unsqueeze_view_0.run(arg2_1, arg4_1, buf0, buf1, s0, stream=stream1) + del arg2_1 + del arg4_1 + buf2 = empty_strided_cuda((s0, 1), (1, 1), torch.int64) + # Topologically Sorted Source Nodes: [flatten, max_1, gather], Original ATen: [aten.view, aten.max, aten.gather] + stream1 = get_raw_stream(1) + triton_poi_fused_gather_max_view_1.run(arg6_1, buf2, s0, stream=stream1) + buf3 = empty_strided_cuda((s0, s87), (s87, 1), torch.bfloat16) + # Topologically Sorted Source Nodes: [flatten, max_1, flat_cs, floordiv, batch_offsets, repeat_interleave, selected_input_index, hidden_states], Original ATen: [aten.view, aten.max, aten.floor_divide, aten.arange, aten.unsqueeze, aten.add, aten.index] + triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2_xnumel = s0*s87 + stream1 = get_raw_stream(1) + triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2.run(arg8_1, buf3, triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2_xnumel, stream=stream1) + del arg8_1 + buf4 = empty_strided_cuda((s0, 1), (1, 1), torch.int64) + # Topologically Sorted Source Nodes: [flatten, max_1, add_2], Original ATen: [aten.view, aten.max, aten.add] + stream1 = get_raw_stream(1) + triton_poi_fused_add_max_view_3.run(buf4, s77, s0, stream=stream1) + return (reinterpret_tensor(buf2, (s0, ), (1, ), 0), buf3, buf1, buf0, arg6_1, buf4, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = 1 + arg1_1 = 2 + arg2_1 = rand_strided((2, 1), (1, 1), device='cuda:1', dtype=torch.float32) + arg3_1 = 2 + arg4_1 = rand_strided((2, 1), (1, 1), device='cuda:1', dtype=torch.float32) + arg5_1 = 2 + arg6_1 = rand_strided((2, 1), (1, 1), device='cuda:1', dtype=torch.int64) + arg7_1 = 6144 + arg8_1 = rand_strided((2, 6144), (6144, 1), device='cuda:1', dtype=torch.bfloat16) + arg9_1 = 1 + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1, arg7_1, arg8_1, arg9_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/mb/cmbfoaa7qkysadnme7v3gwcyocpnn2mwjjg5cpkdqpf5o5t27bro.py b/.inductor_cache/mb/cmbfoaa7qkysadnme7v3gwcyocpnn2mwjjg5cpkdqpf5o5t27bro.py new file mode 100644 index 0000000000000000000000000000000000000000..97318084ad2c0cff65ff7c176c0045249cdfb4a2 --- /dev/null +++ b/.inductor_cache/mb/cmbfoaa7qkysadnme7v3gwcyocpnn2mwjjg5cpkdqpf5o5t27bro.py @@ -0,0 +1,291 @@ +# AOT ID: ['7_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/hj/chjplywvjqptohuj7scdxpy7eoho6x43um4wo56z7eleusgeo6kv.py +# Topologically Sorted Source Nodes: [unsqueeze, view, expand_scores, flatten, max_1], Original ATen: [aten.unsqueeze, aten.view, aten.mul, aten.max] +# Source node to ATen node mapping: +# expand_scores => mul_3 +# flatten => view_1 +# max_1 => getitem, max_1 +# unsqueeze => unsqueeze +# view => view +# Graph fragment: +# %arg2_1 : Tensor "f32[s0, 1][1, 1]cuda:4" = PlaceHolder[target=arg2_1] +# %arg4_1 : Tensor "f32[s0, 1][1, 1]cuda:4" = PlaceHolder[target=arg4_1] +# %mul_3 : Tensor "f32[s0, 1, 1][1, 1, 1]cuda:4" = PlaceHolder[target=mul_3] +# %unsqueeze : Tensor "f32[s0, 1, 1][1, 1, 1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%arg2_1, 2), kwargs = {}) +# %view : Tensor "f32[s0, 1, 1][1, 1, 1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%arg4_1, [-1, 1, 1]), kwargs = {}) +# %mul_3 : Tensor "f32[s0, 1, 1][1, 1, 1]cuda:4"[num_users=2] = call_function[target=torch.ops.aten.mul.Tensor](args = (%unsqueeze, %view), kwargs = {}) +# %view_1 : Tensor "f32[s0, 1][1, 1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg3_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %getitem : Tensor "f32[s0, 1][1, 1]cuda:4"[num_users=1] = call_function[target=operator.getitem](args = (%max_1, 0), kwargs = {}) +# return %mul_3,%getitem +triton_poi_fused_max_mul_unsqueeze_view_0 = async_compile.triton('triton_poi_fused_max_mul_unsqueeze_view_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'out_ptr0': '*fp32', 'out_ptr1': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=4, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_max_mul_unsqueeze_view_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 2, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 192}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_max_mul_unsqueeze_view_0(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp2 = tmp0 * tmp1 + tl.store(out_ptr0 + (x0), tmp2, xmask) + tl.store(out_ptr1 + (x0), tmp2, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/pn/cpner6uolczn44zhjl2hwjnpnblo3rw6gguet6a5o5ueqes2cfo7.py +# Topologically Sorted Source Nodes: [flatten, max_1, gather], Original ATen: [aten.view, aten.max, aten.gather] +# Source node to ATen node mapping: +# flatten => view_1 +# gather => gather +# max_1 => max_1 +# Graph fragment: +# %arg5_1 : Tensor "i64[s0, 1][1, 1]cuda:4" = PlaceHolder[target=arg5_1] +# %view_1 : Tensor "f32[s0, 1][1, 1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg3_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %gather : Tensor "i64[s0, 1][1, 1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.gather.default](args = (%arg5_1, 1, %getitem_1), kwargs = {}) +# return %gather +triton_poi_fused_gather_max_view_1 = async_compile.triton('triton_poi_fused_gather_max_view_1', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=4, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_gather_max_view_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 192}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_gather_max_view_1(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tl.store(out_ptr0 + (x0), tmp0, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/ls/clsiben2w5lcnbhgxdfctbonf7bwxklyzvowh7rxhjlmnmsj365j.py +# Topologically Sorted Source Nodes: [flatten, max_1, flat_cs, floordiv, batch_offsets, repeat_interleave, selected_input_index, hidden_states], Original ATen: [aten.view, aten.max, aten.floor_divide, aten.arange, aten.unsqueeze, aten.add, aten.index] +# Source node to ATen node mapping: +# batch_offsets => iota +# flat_cs => view_4 +# flatten => view_1 +# floordiv => div +# hidden_states => index +# max_1 => max_1 +# repeat_interleave => unsqueeze_1, view_5 +# selected_input_index => add_47 +# Graph fragment: +# %arg7_1 : Tensor "bf16[s0, s87][s87, 1]cuda:4" = PlaceHolder[target=arg7_1] +# %view_1 : Tensor "f32[s0, 1][1, 1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg3_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %view_4 : Tensor "i64[s0][1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%getitem_1, [%arg3_1]), kwargs = {}) +# %div : Tensor "i64[s0][1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.div.Tensor_mode](args = (%view_4, 1), kwargs = {rounding_mode: floor}) +# %iota : Tensor "i64[s0][1]cuda:4"[num_users=1] = call_function[target=torch.ops.prims.iota.default](args = (%arg3_1,), kwargs = {start: 0, step: 1, dtype: torch.int64, device: cuda:4, requires_grad: False}) +# %unsqueeze_1 : Tensor "i64[s0, 1][1, 1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%iota, 1), kwargs = {}) +# %view_5 : Tensor "i64[s0][1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%expand, [%arg3_1]), kwargs = {}) +# %add_47 : Tensor "i64[s0][1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%div, %view_5), kwargs = {}) +# %index : Tensor "bf16[s0, s87][s87, 1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.index.Tensor](args = (%arg7_1, [%add_47]), kwargs = {}) +# return %index +triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2 = async_compile.triton('triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 65536}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*bf16', 'out_ptr0': '*bf16', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=4, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 294912}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x2 = xindex + tmp0 = tl.load(in_ptr0 + (x2), xmask, eviction_policy='evict_last').to(tl.float32) + tl.store(out_ptr0 + (x2), tmp0, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/rl/crltwbaishol4iopibb6vgr7hpf646hjigovxhdihykrppm3ix4g.py +# Topologically Sorted Source Nodes: [flatten, max_1, add_2], Original ATen: [aten.view, aten.max, aten.add] +# Source node to ATen node mapping: +# add_2 => add_53 +# flatten => view_1 +# max_1 => max_1 +# Graph fragment: +# %view_1 : Tensor "f32[s0, 1][1, 1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg3_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %add_53 : Tensor "i64[s0, 1][1, 1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%getitem_1, %arg8_1), kwargs = {}) +# return %add_53 +triton_poi_fused_add_max_view_3 = async_compile.triton('triton_poi_fused_add_max_view_3', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8}, + filename=__file__, + triton_meta={'signature': {'out_ptr0': '*i64', 'ks0': 'i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=4, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_max_view_3', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 0, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 128}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_max_view_3(out_ptr0, ks0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = ks0 + tl.store(out_ptr0 + (x0), tmp0, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1, arg7_1, arg8_1 = args + args.clear() + s53 = arg0_1 + s68 = arg1_1 + s0 = arg3_1 + s87 = arg6_1 + s77 = arg8_1 + assert_size_stride(arg2_1, (s0, 1), (1, 1)) + assert_size_stride(arg4_1, (s0, 1), (1, 1)) + assert_size_stride(arg5_1, (s0, 1), (1, 1)) + assert_size_stride(arg7_1, (s0, s87), (s87, 1)) + with torch.cuda._DeviceGuard(4): + torch.cuda.set_device(4) + buf0 = empty_strided_cuda((s0, 1, 1), (1, 1, 1), torch.float32) + buf1 = empty_strided_cuda((s0, 1), (1, 1), torch.float32) + # Topologically Sorted Source Nodes: [unsqueeze, view, expand_scores, flatten, max_1], Original ATen: [aten.unsqueeze, aten.view, aten.mul, aten.max] + stream4 = get_raw_stream(4) + triton_poi_fused_max_mul_unsqueeze_view_0.run(arg2_1, arg4_1, buf0, buf1, s0, stream=stream4) + del arg2_1 + del arg4_1 + buf2 = empty_strided_cuda((s0, 1), (1, 1), torch.int64) + # Topologically Sorted Source Nodes: [flatten, max_1, gather], Original ATen: [aten.view, aten.max, aten.gather] + stream4 = get_raw_stream(4) + triton_poi_fused_gather_max_view_1.run(arg5_1, buf2, s0, stream=stream4) + buf3 = empty_strided_cuda((s0, s87), (s87, 1), torch.bfloat16) + # Topologically Sorted Source Nodes: [flatten, max_1, flat_cs, floordiv, batch_offsets, repeat_interleave, selected_input_index, hidden_states], Original ATen: [aten.view, aten.max, aten.floor_divide, aten.arange, aten.unsqueeze, aten.add, aten.index] + triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2_xnumel = s0*s87 + stream4 = get_raw_stream(4) + triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2.run(arg7_1, buf3, triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2_xnumel, stream=stream4) + del arg7_1 + buf4 = empty_strided_cuda((s0, 1), (1, 1), torch.int64) + # Topologically Sorted Source Nodes: [flatten, max_1, add_2], Original ATen: [aten.view, aten.max, aten.add] + stream4 = get_raw_stream(4) + triton_poi_fused_add_max_view_3.run(buf4, s77, s0, stream=stream4) + return (reinterpret_tensor(buf2, (s0, ), (1, ), 0), buf3, buf1, buf0, arg5_1, buf4, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = 1 + arg1_1 = 8 + arg2_1 = rand_strided((8, 1), (1, 1), device='cuda:4', dtype=torch.float32) + arg3_1 = 8 + arg4_1 = rand_strided((8, 1), (1, 1), device='cuda:4', dtype=torch.float32) + arg5_1 = rand_strided((8, 1), (1, 1), device='cuda:4', dtype=torch.int64) + arg6_1 = 6144 + arg7_1 = rand_strided((8, 6144), (6144, 1), device='cuda:4', dtype=torch.bfloat16) + arg8_1 = 2 + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1, arg7_1, arg8_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/mo/cmot6tg2bk6v2qya5sx6h2qx6xr6edutqwbzo7rcd2ykpbed7lb6.py b/.inductor_cache/mo/cmot6tg2bk6v2qya5sx6h2qx6xr6edutqwbzo7rcd2ykpbed7lb6.py new file mode 100644 index 0000000000000000000000000000000000000000..d645b77101ce6fdd2b93e8b3a47d78bae204e7b4 --- /dev/null +++ b/.inductor_cache/mo/cmot6tg2bk6v2qya5sx6h2qx6xr6edutqwbzo7rcd2ykpbed7lb6.py @@ -0,0 +1,127 @@ +# AOT ID: ['9_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/wh/cwhk7xmd27albhf3ayzkuaqfrt4dxepjrgrydakgkfblhlcaobh3.py +# Topologically Sorted Source Nodes: [weights_1], Original ATen: [aten.mul] +# Source node to ATen node mapping: +# weights_1 => mul +# Graph fragment: +# %mm : Tensor "f32[1, 32][32, 1]cuda:3" = PlaceHolder[target=mm] +# %mul : Tensor "f32[1, 32][32, 1]cuda:3"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mm, 0.1767766952966369), kwargs = {}) +# return %mul +triton_poi_fused_mul_0 = async_compile.triton('triton_poi_fused_mul_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 32}, + filename=__file__, + triton_meta={'signature': {'in_out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=3, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_0', 'mutated_arg_names': ['in_out_ptr0'], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 384}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_0(in_out_ptr0, xnumel, XBLOCK : tl.constexpr): + xnumel = 32 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_out_ptr0 + (x0), xmask) + tmp1 = tl.full([1], 0.1767766952966369, tl.float32) + tmp2 = tmp0 * tmp1 + tl.store(in_out_ptr0 + (x0), tmp2, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1 = args + args.clear() + assert_size_stride(arg0_1, (32, 6144), (6144, 1)) + assert_size_stride(arg1_1, (1, 6144), (6144, 1)) + with torch.cuda._DeviceGuard(3): + torch.cuda.set_device(3) + buf0 = empty_strided_cuda((1, 32), (32, 1), torch.float32) + # Topologically Sorted Source Nodes: [t, weights], Original ATen: [aten.t, aten.mm] + extern_kernels.mm_dtype(arg1_1, reinterpret_tensor(arg0_1, (6144, 32), (1, 6144), 0), out_dtype=torch.float32, out=buf0) + del arg0_1 + del arg1_1 + buf1 = buf0; del buf0 # reuse + # Topologically Sorted Source Nodes: [weights_1], Original ATen: [aten.mul] + stream3 = get_raw_stream(3) + triton_poi_fused_mul_0.run(buf1, 32, stream=stream3) + return (buf1, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = rand_strided((32, 6144), (6144, 1), device='cuda:3', dtype=torch.bfloat16) + arg1_1 = rand_strided((1, 6144), (6144, 1), device='cuda:3', dtype=torch.bfloat16) + return [arg0_1, arg1_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/mp/cmpvwtxjawcz4o5igjar25tupq3z7ws27jsfnrnioyirz2hmru74.py b/.inductor_cache/mp/cmpvwtxjawcz4o5igjar25tupq3z7ws27jsfnrnioyirz2hmru74.py new file mode 100644 index 0000000000000000000000000000000000000000..64b4abeae21d5c9184d14abefc8132de4cd2d0bd --- /dev/null +++ b/.inductor_cache/mp/cmpvwtxjawcz4o5igjar25tupq3z7ws27jsfnrnioyirz2hmru74.py @@ -0,0 +1,150 @@ +# AOT ID: ['3_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/yb/cybi6dr7sho7j2iatsr32r2n6veqd4slzwsgyc3bp7blaj7nni7w.py +# Topologically Sorted Source Nodes: [weights_1, unsqueeze, mul_1], Original ATen: [aten.mul, aten.unsqueeze] +# Source node to ATen node mapping: +# mul_1 => mul_7 +# unsqueeze => unsqueeze +# weights_1 => mul_2 +# Graph fragment: +# %mm : Tensor "f32[s0, 32][32, 1]cuda:2" = PlaceHolder[target=mm] +# %arg3_1 : Tensor "f32[s0, 32, 1][32, 1, 1]cuda:2" = PlaceHolder[target=arg3_1] +# %arg4_1 : Tensor "f64[][]cpu" = PlaceHolder[target=arg4_1] +# %mul_2 : Tensor "f32[s0, 32][32, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mm, 0.1767766952966369), kwargs = {}) +# %unsqueeze : Tensor "f32[s0, 32, 1][32, 1, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%mul_2, -1), kwargs = {}) +# %mul_7 : Tensor "f32[s0, 32, 1][32, 1, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%unsqueeze, %arg3_1), kwargs = {}) +# %convert_element_type_default_1 : Tensor "f32[][]cpu"[num_users=1] = call_function[target=torch.ops.prims.convert_element_type.default](args = (%arg4_1, torch.float32), kwargs = {}) +# %mul_tensor : Tensor "f32[s0, 32, 1][32, 1, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mul_7, %convert_element_type_default_1), kwargs = {}) +# return %mul_tensor +triton_poi_fused_mul_unsqueeze_0 = async_compile.triton('triton_poi_fused_mul_unsqueeze_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 2048}, + filename=__file__, + triton_meta={'signature': {'in_out_ptr0': '*fp32', 'in_ptr0': '*fp32', 'in_ptr1': 'fp64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=2, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_unsqueeze_0', 'mutated_arg_names': ['in_out_ptr0'], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 3, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 28672}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_unsqueeze_0(in_out_ptr0, in_ptr0, in_ptr1, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_out_ptr0 + (x0), xmask) + tmp3 = tl.load(in_ptr0 + (x0), xmask) + tmp5 = in_ptr1 + tmp1 = tl.full([1], 0.1767766952966369, tl.float32) + tmp2 = tmp0 * tmp1 + tmp4 = tmp2 * tmp3 + tmp6 = tmp5.to(tl.float32) + tmp7 = tmp4 * tmp6 + tl.store(in_out_ptr0 + (x0), tmp7, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1 = args + args.clear() + s77 = arg1_1 + arg2_1_size = arg2_1.size() + s0 = arg2_1_size[0] + assert_size_stride(arg0_1, (32, 6144), (6144, 1)) + assert_size_stride(arg2_1, (s0, 6144), (6144, 1)) + assert_size_stride(arg3_1, (s0, 32, 1), (32, 1, 1)) + assert_size_stride(arg4_1, (), ()) + with torch.cuda._DeviceGuard(2): + torch.cuda.set_device(2) + buf0 = empty_strided_cuda((s0, 32), (32, 1), torch.float32) + # Topologically Sorted Source Nodes: [t, weights], Original ATen: [aten.t, aten.mm] + extern_kernels.mm_dtype(arg2_1, reinterpret_tensor(arg0_1, (6144, 32), (1, 6144), 0), out_dtype=torch.float32, out=buf0) + del arg0_1 + del arg2_1 + buf1 = reinterpret_tensor(buf0, (s0, 32, 1), (32, 1, 1), 0); del buf0 # reuse + # Topologically Sorted Source Nodes: [weights_1, unsqueeze, mul_1], Original ATen: [aten.mul, aten.unsqueeze] + triton_poi_fused_mul_unsqueeze_0_xnumel = 32*s0 + stream2 = get_raw_stream(2) + triton_poi_fused_mul_unsqueeze_0.run(buf1, arg3_1, arg4_1.item(), triton_poi_fused_mul_unsqueeze_0_xnumel, stream=stream2) + del arg3_1 + del arg4_1 + return (buf1, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = rand_strided((32, 6144), (6144, 1), device='cuda:2', dtype=torch.bfloat16) + arg1_1 = 56 + arg2_1 = rand_strided((56, 6144), (6144, 1), device='cuda:2', dtype=torch.bfloat16) + arg3_1 = rand_strided((56, 32, 1), (32, 1, 1), device='cuda:2', dtype=torch.float32) + arg4_1 = rand_strided((), (), device='cpu', dtype=torch.float64) + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/mw/cmwo3oplzoxl3jmuphuwdb37kx5ted543eswidxdktdu3ofpcndz.py b/.inductor_cache/mw/cmwo3oplzoxl3jmuphuwdb37kx5ted543eswidxdktdu3ofpcndz.py new file mode 100644 index 0000000000000000000000000000000000000000..2dc99dd64372c53f8c5a90f13c69b6b93b8c9662 --- /dev/null +++ b/.inductor_cache/mw/cmwo3oplzoxl3jmuphuwdb37kx5ted543eswidxdktdu3ofpcndz.py @@ -0,0 +1,37 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i1', 'ks0': 'i64', 'ks1': 'i64', 'ks2': 'i64', 'ks3': 'i64', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=0, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_bitwise_and_bitwise_not_bitwise_or_ge_lt_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_bitwise_and_bitwise_not_bitwise_or_ge_lt_1(in_ptr0, out_ptr0, ks0, ks1, ks2, ks3, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = tl.load(in_ptr0 + (0)) + tmp1 = tl.broadcast_to(tmp0, [XBLOCK]) + tmp2 = ks0 + tmp3 = tmp1 >= tmp2 + tmp4 = ks1 + tmp5 = tmp1 < tmp4 + tmp6 = tmp3 & tmp5 + tmp7 = ks2 + tmp8 = tmp1 >= tmp7 + tmp9 = ks3 + tmp10 = tmp1 < tmp9 + tmp11 = tmp8 & tmp10 + tmp12 = tmp6 | tmp11 + tmp13 = tmp12 == 0 + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp13, None) diff --git a/.inductor_cache/mz/cmzyybpwh6qmtcq7gwcqgwbieukiskiqslaso7ig7lcotivioxzy.py b/.inductor_cache/mz/cmzyybpwh6qmtcq7gwcqgwbieukiskiqslaso7ig7lcotivioxzy.py new file mode 100644 index 0000000000000000000000000000000000000000..f977eef7338b352386c40a29c2abb2c620670df7 --- /dev/null +++ b/.inductor_cache/mz/cmzyybpwh6qmtcq7gwcqgwbieukiskiqslaso7ig7lcotivioxzy.py @@ -0,0 +1,24 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8}, + filename=__file__, + triton_meta={'signature': {'out_ptr0': '*i64', 'ks0': 'i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=5, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_max_view_3', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 0, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 128}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_max_view_3(out_ptr0, ks0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = ks0 + tl.store(out_ptr0 + (x0), tmp0, xmask) diff --git a/.inductor_cache/n3/cn3dxyhsm6idd5xznaugp2kpl2vzbms5pnw6tuvl7ht2eu3wyfyp.py b/.inductor_cache/n3/cn3dxyhsm6idd5xznaugp2kpl2vzbms5pnw6tuvl7ht2eu3wyfyp.py new file mode 100644 index 0000000000000000000000000000000000000000..f823a23e3df5b8842eb4beb08f1c25b2f6d50b4b --- /dev/null +++ b/.inductor_cache/n3/cn3dxyhsm6idd5xznaugp2kpl2vzbms5pnw6tuvl7ht2eu3wyfyp.py @@ -0,0 +1,291 @@ +# AOT ID: ['7_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/r5/cr5stpc42p6e7gax2rhgvljylqkx5emjgqht2op5w5hwiihekryz.py +# Topologically Sorted Source Nodes: [unsqueeze, view, expand_scores, flatten, max_1], Original ATen: [aten.unsqueeze, aten.view, aten.mul, aten.max] +# Source node to ATen node mapping: +# expand_scores => mul_3 +# flatten => view_1 +# max_1 => getitem, max_1 +# unsqueeze => unsqueeze +# view => view +# Graph fragment: +# %arg2_1 : Tensor "f32[s0, 1][1, 1]cuda:2" = PlaceHolder[target=arg2_1] +# %arg4_1 : Tensor "f32[s0, 1][1, 1]cuda:2" = PlaceHolder[target=arg4_1] +# %mul_3 : Tensor "f32[s0, 1, 1][1, 1, 1]cuda:2" = PlaceHolder[target=mul_3] +# %unsqueeze : Tensor "f32[s0, 1, 1][1, 1, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%arg2_1, 2), kwargs = {}) +# %view : Tensor "f32[s0, 1, 1][1, 1, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%arg4_1, [-1, 1, 1]), kwargs = {}) +# %mul_3 : Tensor "f32[s0, 1, 1][1, 1, 1]cuda:2"[num_users=2] = call_function[target=torch.ops.aten.mul.Tensor](args = (%unsqueeze, %view), kwargs = {}) +# %view_1 : Tensor "f32[s0, 1][1, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg3_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %getitem : Tensor "f32[s0, 1][1, 1]cuda:2"[num_users=1] = call_function[target=operator.getitem](args = (%max_1, 0), kwargs = {}) +# return %mul_3,%getitem +triton_poi_fused_max_mul_unsqueeze_view_0 = async_compile.triton('triton_poi_fused_max_mul_unsqueeze_view_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'out_ptr0': '*fp32', 'out_ptr1': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=2, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_max_mul_unsqueeze_view_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 2, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 192}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_max_mul_unsqueeze_view_0(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp2 = tmp0 * tmp1 + tl.store(out_ptr0 + (x0), tmp2, xmask) + tl.store(out_ptr1 + (x0), tmp2, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/wv/cwv4bhf4zja523ayx77cdw4dkzcexjyttmndegvltrh5pklgztw2.py +# Topologically Sorted Source Nodes: [flatten, max_1, gather], Original ATen: [aten.view, aten.max, aten.gather] +# Source node to ATen node mapping: +# flatten => view_1 +# gather => gather +# max_1 => max_1 +# Graph fragment: +# %arg5_1 : Tensor "i64[s0, 1][1, 1]cuda:2" = PlaceHolder[target=arg5_1] +# %view_1 : Tensor "f32[s0, 1][1, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg3_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %gather : Tensor "i64[s0, 1][1, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.gather.default](args = (%arg5_1, 1, %getitem_1), kwargs = {}) +# return %gather +triton_poi_fused_gather_max_view_1 = async_compile.triton('triton_poi_fused_gather_max_view_1', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=2, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_gather_max_view_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 192}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_gather_max_view_1(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tl.store(out_ptr0 + (x0), tmp0, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/wi/cwiqfcswhex7vhj7ibleyueyqjfnmbmvnwp4neq7ywlmz4gnod3j.py +# Topologically Sorted Source Nodes: [flatten, max_1, flat_cs, floordiv, batch_offsets, repeat_interleave, selected_input_index, hidden_states], Original ATen: [aten.view, aten.max, aten.floor_divide, aten.arange, aten.unsqueeze, aten.add, aten.index] +# Source node to ATen node mapping: +# batch_offsets => iota +# flat_cs => view_4 +# flatten => view_1 +# floordiv => div +# hidden_states => index +# max_1 => max_1 +# repeat_interleave => unsqueeze_1, view_5 +# selected_input_index => add_47 +# Graph fragment: +# %arg7_1 : Tensor "bf16[s0, s87][s87, 1]cuda:2" = PlaceHolder[target=arg7_1] +# %view_1 : Tensor "f32[s0, 1][1, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg3_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %view_4 : Tensor "i64[s0][1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%getitem_1, [%arg3_1]), kwargs = {}) +# %div : Tensor "i64[s0][1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.div.Tensor_mode](args = (%view_4, 1), kwargs = {rounding_mode: floor}) +# %iota : Tensor "i64[s0][1]cuda:2"[num_users=1] = call_function[target=torch.ops.prims.iota.default](args = (%arg3_1,), kwargs = {start: 0, step: 1, dtype: torch.int64, device: cuda:2, requires_grad: False}) +# %unsqueeze_1 : Tensor "i64[s0, 1][1, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%iota, 1), kwargs = {}) +# %view_5 : Tensor "i64[s0][1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%expand, [%arg3_1]), kwargs = {}) +# %add_47 : Tensor "i64[s0][1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%div, %view_5), kwargs = {}) +# %index : Tensor "bf16[s0, s87][s87, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.index.Tensor](args = (%arg7_1, [%add_47]), kwargs = {}) +# return %index +triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2 = async_compile.triton('triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 65536}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*bf16', 'out_ptr0': '*bf16', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=2, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 294912}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x2 = xindex + tmp0 = tl.load(in_ptr0 + (x2), xmask, eviction_policy='evict_last').to(tl.float32) + tl.store(out_ptr0 + (x2), tmp0, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/f5/cf5tdx3gnxtntosmkamwgpfawabhai5ev6kn6ewzs2f6jcc5k3yw.py +# Topologically Sorted Source Nodes: [flatten, max_1, add_2], Original ATen: [aten.view, aten.max, aten.add] +# Source node to ATen node mapping: +# add_2 => add_53 +# flatten => view_1 +# max_1 => max_1 +# Graph fragment: +# %view_1 : Tensor "f32[s0, 1][1, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg3_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %add_53 : Tensor "i64[s0, 1][1, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%getitem_1, %arg8_1), kwargs = {}) +# return %add_53 +triton_poi_fused_add_max_view_3 = async_compile.triton('triton_poi_fused_add_max_view_3', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8}, + filename=__file__, + triton_meta={'signature': {'out_ptr0': '*i64', 'ks0': 'i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=2, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_max_view_3', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 0, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 128}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_max_view_3(out_ptr0, ks0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = ks0 + tl.store(out_ptr0 + (x0), tmp0, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1, arg7_1, arg8_1 = args + args.clear() + s53 = arg0_1 + s68 = arg1_1 + s0 = arg3_1 + s87 = arg6_1 + s77 = arg8_1 + assert_size_stride(arg2_1, (s0, 1), (1, 1)) + assert_size_stride(arg4_1, (s0, 1), (1, 1)) + assert_size_stride(arg5_1, (s0, 1), (1, 1)) + assert_size_stride(arg7_1, (s0, s87), (s87, 1)) + with torch.cuda._DeviceGuard(2): + torch.cuda.set_device(2) + buf0 = empty_strided_cuda((s0, 1, 1), (1, 1, 1), torch.float32) + buf1 = empty_strided_cuda((s0, 1), (1, 1), torch.float32) + # Topologically Sorted Source Nodes: [unsqueeze, view, expand_scores, flatten, max_1], Original ATen: [aten.unsqueeze, aten.view, aten.mul, aten.max] + stream2 = get_raw_stream(2) + triton_poi_fused_max_mul_unsqueeze_view_0.run(arg2_1, arg4_1, buf0, buf1, s0, stream=stream2) + del arg2_1 + del arg4_1 + buf2 = empty_strided_cuda((s0, 1), (1, 1), torch.int64) + # Topologically Sorted Source Nodes: [flatten, max_1, gather], Original ATen: [aten.view, aten.max, aten.gather] + stream2 = get_raw_stream(2) + triton_poi_fused_gather_max_view_1.run(arg5_1, buf2, s0, stream=stream2) + buf3 = empty_strided_cuda((s0, s87), (s87, 1), torch.bfloat16) + # Topologically Sorted Source Nodes: [flatten, max_1, flat_cs, floordiv, batch_offsets, repeat_interleave, selected_input_index, hidden_states], Original ATen: [aten.view, aten.max, aten.floor_divide, aten.arange, aten.unsqueeze, aten.add, aten.index] + triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2_xnumel = s0*s87 + stream2 = get_raw_stream(2) + triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2.run(arg7_1, buf3, triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2_xnumel, stream=stream2) + del arg7_1 + buf4 = empty_strided_cuda((s0, 1), (1, 1), torch.int64) + # Topologically Sorted Source Nodes: [flatten, max_1, add_2], Original ATen: [aten.view, aten.max, aten.add] + stream2 = get_raw_stream(2) + triton_poi_fused_add_max_view_3.run(buf4, s77, s0, stream=stream2) + return (reinterpret_tensor(buf2, (s0, ), (1, ), 0), buf3, buf1, buf0, arg5_1, buf4, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = 1 + arg1_1 = 8 + arg2_1 = rand_strided((8, 1), (1, 1), device='cuda:2', dtype=torch.float32) + arg3_1 = 8 + arg4_1 = rand_strided((8, 1), (1, 1), device='cuda:2', dtype=torch.float32) + arg5_1 = rand_strided((8, 1), (1, 1), device='cuda:2', dtype=torch.int64) + arg6_1 = 6144 + arg7_1 = rand_strided((8, 6144), (6144, 1), device='cuda:2', dtype=torch.bfloat16) + arg8_1 = 2 + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1, arg7_1, arg8_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/n6/cn64ytsgtpbvrqo6un2gwerphqubtrkl7jt2gdmng2fq2tbv6hiw.py b/.inductor_cache/n6/cn64ytsgtpbvrqo6un2gwerphqubtrkl7jt2gdmng2fq2tbv6hiw.py new file mode 100644 index 0000000000000000000000000000000000000000..5c58dd3d382451a441df3eaa04d4df820b32f5af --- /dev/null +++ b/.inductor_cache/n6/cn64ytsgtpbvrqo6un2gwerphqubtrkl7jt2gdmng2fq2tbv6hiw.py @@ -0,0 +1,37 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i1', 'ks0': 'i64', 'ks1': 'i64', 'ks2': 'i64', 'ks3': 'i64', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=1, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_bitwise_and_bitwise_not_bitwise_or_ge_lt_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_bitwise_and_bitwise_not_bitwise_or_ge_lt_1(in_ptr0, out_ptr0, ks0, ks1, ks2, ks3, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = tl.load(in_ptr0 + (0)) + tmp1 = tl.broadcast_to(tmp0, [XBLOCK]) + tmp2 = ks0 + tmp3 = tmp1 >= tmp2 + tmp4 = ks1 + tmp5 = tmp1 < tmp4 + tmp6 = tmp3 & tmp5 + tmp7 = ks2 + tmp8 = tmp1 >= tmp7 + tmp9 = ks3 + tmp10 = tmp1 < tmp9 + tmp11 = tmp8 & tmp10 + tmp12 = tmp6 | tmp11 + tmp13 = tmp12 == 0 + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp13, None) diff --git a/.inductor_cache/nb/cnbxdkprxtvekw7oedqozqje365hsugz663nw5ynns6stdgv435d.py b/.inductor_cache/nb/cnbxdkprxtvekw7oedqozqje365hsugz663nw5ynns6stdgv435d.py new file mode 100644 index 0000000000000000000000000000000000000000..008b6297700b0f6bb3dbe86b7402a5d87df8543f --- /dev/null +++ b/.inductor_cache/nb/cnbxdkprxtvekw7oedqozqje365hsugz663nw5ynns6stdgv435d.py @@ -0,0 +1,289 @@ +# AOT ID: ['6_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/xh/cxh7sezmoqxcccmmupak5i6lq3msgfodcae6rcxakp76aq3atfnr.py +# Topologically Sorted Source Nodes: [unsqueeze, view, expand_scores, flatten, max_1], Original ATen: [aten.unsqueeze, aten.view, aten.mul, aten.max] +# Source node to ATen node mapping: +# expand_scores => mul_3 +# flatten => view_1 +# max_1 => getitem, max_1 +# unsqueeze => unsqueeze +# view => view +# Graph fragment: +# %arg2_1 : Tensor "f32[s97, 1][1, 1]cuda:7" = PlaceHolder[target=arg2_1] +# %arg3_1 : Tensor "f32[s97, 1][1, 1]cuda:7" = PlaceHolder[target=arg3_1] +# %mul_3 : Tensor "f32[s97, 1, 1][1, 1, 1]cuda:7" = PlaceHolder[target=mul_3] +# %unsqueeze : Tensor "f32[s97, 1, 1][1, 1, 1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%arg2_1, 2), kwargs = {}) +# %view : Tensor "f32[s97, 1, 1][1, 1, 1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%arg3_1, [-1, 1, 1]), kwargs = {}) +# %mul_3 : Tensor "f32[s97, 1, 1][1, 1, 1]cuda:7"[num_users=2] = call_function[target=torch.ops.aten.mul.Tensor](args = (%unsqueeze, %view), kwargs = {}) +# %view_1 : Tensor "f32[s97, 1][1, 1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg1_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %getitem : Tensor "f32[s97, 1][1, 1]cuda:7"[num_users=1] = call_function[target=operator.getitem](args = (%max_1, 0), kwargs = {}) +# return %mul_3,%getitem +triton_poi_fused_max_mul_unsqueeze_view_0 = async_compile.triton('triton_poi_fused_max_mul_unsqueeze_view_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'out_ptr0': '*fp32', 'out_ptr1': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=7, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_max_mul_unsqueeze_view_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 2, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 192}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_max_mul_unsqueeze_view_0(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp2 = tmp0 * tmp1 + tl.store(out_ptr0 + (x0), tmp2, xmask) + tl.store(out_ptr1 + (x0), tmp2, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/3h/c3hjatdysmtczt36qylu5u476tmnxdvxgytr7m6z4na54xrxxoss.py +# Topologically Sorted Source Nodes: [flatten, max_1, gather], Original ATen: [aten.view, aten.max, aten.gather] +# Source node to ATen node mapping: +# flatten => view_1 +# gather => gather +# max_1 => max_1 +# Graph fragment: +# %arg4_1 : Tensor "i64[s97, 1][1, 1]cuda:7" = PlaceHolder[target=arg4_1] +# %view_1 : Tensor "f32[s97, 1][1, 1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg1_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %gather : Tensor "i64[s97, 1][1, 1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.gather.default](args = (%arg4_1, 1, %getitem_1), kwargs = {}) +# return %gather +triton_poi_fused_gather_max_view_1 = async_compile.triton('triton_poi_fused_gather_max_view_1', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=7, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_gather_max_view_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 192}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_gather_max_view_1(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tl.store(out_ptr0 + (x0), tmp0, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/ro/cround23pf4qaktlwffp3qcbjyrgot7o6kfowlbg2y4yepoaour2.py +# Topologically Sorted Source Nodes: [flatten, max_1, flat_cs, floordiv, batch_offsets, repeat_interleave, selected_input_index, hidden_states], Original ATen: [aten.view, aten.max, aten.floor_divide, aten.arange, aten.unsqueeze, aten.add, aten.index] +# Source node to ATen node mapping: +# batch_offsets => iota +# flat_cs => view_4 +# flatten => view_1 +# floordiv => div +# hidden_states => index +# max_1 => max_1 +# repeat_interleave => unsqueeze_1, view_5 +# selected_input_index => add_47 +# Graph fragment: +# %arg6_1 : Tensor "bf16[s97, s87][s87, 1]cuda:7" = PlaceHolder[target=arg6_1] +# %view_1 : Tensor "f32[s97, 1][1, 1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg1_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %view_4 : Tensor "i64[s97][1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%getitem_1, [%arg1_1]), kwargs = {}) +# %div : Tensor "i64[s97][1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.div.Tensor_mode](args = (%view_4, 1), kwargs = {rounding_mode: floor}) +# %iota : Tensor "i64[s97][1]cuda:7"[num_users=1] = call_function[target=torch.ops.prims.iota.default](args = (%arg1_1,), kwargs = {start: 0, step: 1, dtype: torch.int64, device: cuda:7, requires_grad: False}) +# %unsqueeze_1 : Tensor "i64[s97, 1][1, 1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%iota, 1), kwargs = {}) +# %view_5 : Tensor "i64[s97][1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%expand, [%arg1_1]), kwargs = {}) +# %add_47 : Tensor "i64[s97][1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%div, %view_5), kwargs = {}) +# %index : Tensor "bf16[s97, s87][s87, 1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.index.Tensor](args = (%arg6_1, [%add_47]), kwargs = {}) +# return %index +triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2 = async_compile.triton('triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 65536}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*bf16', 'out_ptr0': '*bf16', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=7, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 294912}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x2 = xindex + tmp0 = tl.load(in_ptr0 + (x2), xmask, eviction_policy='evict_last').to(tl.float32) + tl.store(out_ptr0 + (x2), tmp0, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/76/c76y7ge3o24p7dwc6aulba5id74axw62oevitux7yjjlbrbsx66u.py +# Topologically Sorted Source Nodes: [flatten, max_1, add_2], Original ATen: [aten.view, aten.max, aten.add] +# Source node to ATen node mapping: +# add_2 => add_53 +# flatten => view_1 +# max_1 => max_1 +# Graph fragment: +# %view_1 : Tensor "f32[s97, 1][1, 1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg1_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %add_53 : Tensor "i64[s97, 1][1, 1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%getitem_1, %arg7_1), kwargs = {}) +# return %add_53 +triton_poi_fused_add_max_view_3 = async_compile.triton('triton_poi_fused_add_max_view_3', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8}, + filename=__file__, + triton_meta={'signature': {'out_ptr0': '*i64', 'ks0': 'i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=7, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_max_view_3', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 0, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 128}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_max_view_3(out_ptr0, ks0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = ks0 + tl.store(out_ptr0 + (x0), tmp0, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1, arg7_1 = args + args.clear() + s53 = arg0_1 + s97 = arg1_1 + s87 = arg5_1 + s77 = arg7_1 + assert_size_stride(arg2_1, (s97, 1), (1, 1)) + assert_size_stride(arg3_1, (s97, 1), (1, 1)) + assert_size_stride(arg4_1, (s97, 1), (1, 1)) + assert_size_stride(arg6_1, (s97, s87), (s87, 1)) + with torch.cuda._DeviceGuard(7): + torch.cuda.set_device(7) + buf0 = empty_strided_cuda((s97, 1, 1), (1, 1, 1), torch.float32) + buf1 = empty_strided_cuda((s97, 1), (1, 1), torch.float32) + # Topologically Sorted Source Nodes: [unsqueeze, view, expand_scores, flatten, max_1], Original ATen: [aten.unsqueeze, aten.view, aten.mul, aten.max] + stream7 = get_raw_stream(7) + triton_poi_fused_max_mul_unsqueeze_view_0.run(arg2_1, arg3_1, buf0, buf1, s97, stream=stream7) + del arg2_1 + del arg3_1 + buf2 = empty_strided_cuda((s97, 1), (1, 1), torch.int64) + # Topologically Sorted Source Nodes: [flatten, max_1, gather], Original ATen: [aten.view, aten.max, aten.gather] + stream7 = get_raw_stream(7) + triton_poi_fused_gather_max_view_1.run(arg4_1, buf2, s97, stream=stream7) + buf3 = empty_strided_cuda((s97, s87), (s87, 1), torch.bfloat16) + # Topologically Sorted Source Nodes: [flatten, max_1, flat_cs, floordiv, batch_offsets, repeat_interleave, selected_input_index, hidden_states], Original ATen: [aten.view, aten.max, aten.floor_divide, aten.arange, aten.unsqueeze, aten.add, aten.index] + triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2_xnumel = s87*s97 + stream7 = get_raw_stream(7) + triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2.run(arg6_1, buf3, triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2_xnumel, stream=stream7) + del arg6_1 + buf4 = empty_strided_cuda((s97, 1), (1, 1), torch.int64) + # Topologically Sorted Source Nodes: [flatten, max_1, add_2], Original ATen: [aten.view, aten.max, aten.add] + stream7 = get_raw_stream(7) + triton_poi_fused_add_max_view_3.run(buf4, s77, s97, stream=stream7) + return (reinterpret_tensor(buf2, (s97, ), (1, ), 0), buf3, buf1, buf0, arg4_1, buf4, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = 1 + arg1_1 = 8 + arg2_1 = rand_strided((8, 1), (1, 1), device='cuda:7', dtype=torch.float32) + arg3_1 = rand_strided((8, 1), (1, 1), device='cuda:7', dtype=torch.float32) + arg4_1 = rand_strided((8, 1), (1, 1), device='cuda:7', dtype=torch.int64) + arg5_1 = 6144 + arg6_1 = rand_strided((8, 6144), (6144, 1), device='cuda:7', dtype=torch.bfloat16) + arg7_1 = 1 + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1, arg7_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/nc/cnc5s3w6ila62i5yb57raw7vhphubcxtn2ptd46mlhpnp5o5f437.py b/.inductor_cache/nc/cnc5s3w6ila62i5yb57raw7vhphubcxtn2ptd46mlhpnp5o5f437.py new file mode 100644 index 0000000000000000000000000000000000000000..fd7bee72d20454435000457cb35cbbdc45425761 --- /dev/null +++ b/.inductor_cache/nc/cnc5s3w6ila62i5yb57raw7vhphubcxtn2ptd46mlhpnp5o5f437.py @@ -0,0 +1,27 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 32}, + filename=__file__, + triton_meta={'signature': {'in_out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=6, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_0', 'mutated_arg_names': ['in_out_ptr0'], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 384}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_0(in_out_ptr0, xnumel, XBLOCK : tl.constexpr): + xnumel = 32 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_out_ptr0 + (x0), xmask) + tmp1 = tl.full([1], 0.1767766952966369, tl.float32) + tmp2 = tmp0 * tmp1 + tl.store(in_out_ptr0 + (x0), tmp2, xmask) diff --git a/.inductor_cache/nq/cnqbp6kjluj4ekcqcep6mzlu4tc72vz5b6ebts34lz2rh6egs2zg.py b/.inductor_cache/nq/cnqbp6kjluj4ekcqcep6mzlu4tc72vz5b6ebts34lz2rh6egs2zg.py new file mode 100644 index 0000000000000000000000000000000000000000..e93cd8bf9611a6301d7212eecc4018d65bee7ed3 --- /dev/null +++ b/.inductor_cache/nq/cnqbp6kjluj4ekcqcep6mzlu4tc72vz5b6ebts34lz2rh6egs2zg.py @@ -0,0 +1,29 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'out_ptr0': '*fp32', 'out_ptr1': '*fp32', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=1, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_max_mul_unsqueeze_view_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 2, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_max_mul_unsqueeze_view_0(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = tl.load(in_ptr0 + (0)) + tmp1 = tl.broadcast_to(tmp0, [XBLOCK]) + tmp2 = tl.load(in_ptr1 + (0)) + tmp3 = tl.broadcast_to(tmp2, [XBLOCK]) + tmp4 = tmp1 * tmp3 + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp4, None) + tl.store(out_ptr1 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp4, None) diff --git a/.inductor_cache/nu/c0bf6deca55b214c47ad72a0069071fcfaaaae37e47b4d65a2c0ddd5256b07db.best_config b/.inductor_cache/nu/c0bf6deca55b214c47ad72a0069071fcfaaaae37e47b4d65a2c0ddd5256b07db.best_config new file mode 100644 index 0000000000000000000000000000000000000000..3043f6ecbee1167eec78e50d073e1b91074eb648 --- /dev/null +++ b/.inductor_cache/nu/c0bf6deca55b214c47ad72a0069071fcfaaaae37e47b4d65a2c0ddd5256b07db.best_config @@ -0,0 +1 @@ +{"XBLOCK": 256, "num_warps": 4, "num_stages": 1, "configs_hash": "1b2cc4dbebb9680d3ce31843331593b159e4046c056f195ca1ccf2464d5b37d1", "found_by_coordesc": false, "time_taken_ms": 50, "triton_cache_hash": "KGGY5WAIFCN23ENKRQFNT2OZB6CJLZGZIIMD5KHX6XAEJ3DEY7VA"} \ No newline at end of file diff --git a/.inductor_cache/nu/cnugnrk6jfhqwpdmpfwoftn2zrxw6uvqpkanjzekdnahjq2s2tts.py b/.inductor_cache/nu/cnugnrk6jfhqwpdmpfwoftn2zrxw6uvqpkanjzekdnahjq2s2tts.py new file mode 100644 index 0000000000000000000000000000000000000000..01d971a7861ee6f7079f78a6842484ba1f16a6d3 --- /dev/null +++ b/.inductor_cache/nu/cnugnrk6jfhqwpdmpfwoftn2zrxw6uvqpkanjzekdnahjq2s2tts.py @@ -0,0 +1,31 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 2048}, + filename=__file__, + triton_meta={'signature': {'in_out_ptr0': '*fp32', 'in_ptr0': '*fp32', 'in_ptr1': 'fp64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=0, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_unsqueeze_0', 'mutated_arg_names': ['in_out_ptr0'], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 3, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 28672}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_unsqueeze_0(in_out_ptr0, in_ptr0, in_ptr1, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_out_ptr0 + (x0), xmask) + tmp3 = tl.load(in_ptr0 + (x0), xmask) + tmp5 = in_ptr1 + tmp1 = tl.full([1], 0.1767766952966369, tl.float32) + tmp2 = tmp0 * tmp1 + tmp4 = tmp2 * tmp3 + tmp6 = tmp5.to(tl.float32) + tmp7 = tmp4 * tmp6 + tl.store(in_out_ptr0 + (x0), tmp7, xmask) diff --git a/.inductor_cache/o4/co4zebjtgk2tpyvrppuqw7ind4bqqkoj2cuonu45vm7hnxwx5f3c.py b/.inductor_cache/o4/co4zebjtgk2tpyvrppuqw7ind4bqqkoj2cuonu45vm7hnxwx5f3c.py new file mode 100644 index 0000000000000000000000000000000000000000..397a426550ebc383954a3bd5b3a4268b1f2dccd9 --- /dev/null +++ b/.inductor_cache/o4/co4zebjtgk2tpyvrppuqw7ind4bqqkoj2cuonu45vm7hnxwx5f3c.py @@ -0,0 +1,142 @@ +# AOT ID: ['5_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/25/c25l73lomz5i5p2tjttjp4w3njz7barnpiaq2fsgnq3jaafgxdsu.py +# Topologically Sorted Source Nodes: [unsqueeze, mul], Original ATen: [aten.unsqueeze, aten.mul] +# Source node to ATen node mapping: +# mul => mul_2 +# unsqueeze => unsqueeze +# Graph fragment: +# %arg2_1 : Tensor "f32[s0, s3][s3, 1]cuda:5" = PlaceHolder[target=arg2_1] +# %arg3_1 : Tensor "f32[s0, s3, 1][s3, 1, 1]cuda:5" = PlaceHolder[target=arg3_1] +# %arg4_1 : Tensor "f64[][]cpu" = PlaceHolder[target=arg4_1] +# %unsqueeze : Tensor "f32[s0, s3, 1][s3, 1, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%arg2_1, -1), kwargs = {}) +# %mul_2 : Tensor "f32[s0, s3, 1][s3, 1, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%unsqueeze, %arg3_1), kwargs = {}) +# %convert_element_type_default_1 : Tensor "f32[][]cpu"[num_users=1] = call_function[target=torch.ops.prims.convert_element_type.default](args = (%arg4_1, torch.float32), kwargs = {}) +# %mul_tensor : Tensor "f32[s0, s3, 1][s3, 1, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mul_2, %convert_element_type_default_1), kwargs = {}) +# return %mul_tensor +triton_poi_fused_mul_unsqueeze_0 = async_compile.triton('triton_poi_fused_mul_unsqueeze_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 256}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'in_ptr2': 'fp64', 'out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=5, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_unsqueeze_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 3, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 4096}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_unsqueeze_0(in_ptr0, in_ptr1, in_ptr2, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp3 = in_ptr2 + tmp2 = tmp0 * tmp1 + tmp4 = tmp3.to(tl.float32) + tmp5 = tmp2 * tmp4 + tl.store(out_ptr0 + (x0), tmp5, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1 = args + args.clear() + s7 = arg0_1 + s3 = arg1_1 + arg2_1_size = arg2_1.size() + s0 = arg2_1_size[0] + assert_size_stride(arg2_1, (s0, s3), (s3, 1)) + assert_size_stride(arg3_1, (s0, s3, 1), (s3, 1, 1)) + assert_size_stride(arg4_1, (), ()) + with torch.cuda._DeviceGuard(5): + torch.cuda.set_device(5) + buf0 = empty_strided_cuda((s0, s3, 1), (s3, 1, 1), torch.float32) + # Topologically Sorted Source Nodes: [unsqueeze, mul], Original ATen: [aten.unsqueeze, aten.mul] + triton_poi_fused_mul_unsqueeze_0_xnumel = s0*s3 + stream5 = get_raw_stream(5) + triton_poi_fused_mul_unsqueeze_0.run(arg2_1, arg3_1, arg4_1.item(), buf0, triton_poi_fused_mul_unsqueeze_0_xnumel, stream=stream5) + del arg2_1 + del arg3_1 + del arg4_1 + return (buf0, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = 8 + arg1_1 = 32 + arg2_1 = rand_strided((8, 32), (32, 1), device='cuda:5', dtype=torch.float32) + arg3_1 = rand_strided((8, 32, 1), (32, 1, 1), device='cuda:5', dtype=torch.float32) + arg4_1 = rand_strided((), (), device='cpu', dtype=torch.float64) + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/o6/70e61caf2df21c1df54a82f6d0fdaec1d89bba5730569d134aa895b9fc5a7e40.best_config b/.inductor_cache/o6/70e61caf2df21c1df54a82f6d0fdaec1d89bba5730569d134aa895b9fc5a7e40.best_config new file mode 100644 index 0000000000000000000000000000000000000000..f523c8ace74d4450540cc45fcdd06a3b9e2dcf68 --- /dev/null +++ b/.inductor_cache/o6/70e61caf2df21c1df54a82f6d0fdaec1d89bba5730569d134aa895b9fc5a7e40.best_config @@ -0,0 +1 @@ +{"XBLOCK": 256, "num_warps": 4, "num_stages": 1, "configs_hash": "7cced77f371acaa5aa7d90332a90e0c907727cfefb71d9cc9d997c24557fc44f", "found_by_coordesc": false, "time_taken_ms": 22, "triton_cache_hash": "QLXJTPJWIG7LHGEN76P7EYFUJIJLXLDECRO3I6NRHSQ4NBZC2KMA"} \ No newline at end of file diff --git a/.inductor_cache/o6/co6hyomcl3npwceolu64q5bdvrb7h6qa4h3fycnlkntxzzmdzmue.py b/.inductor_cache/o6/co6hyomcl3npwceolu64q5bdvrb7h6qa4h3fycnlkntxzzmdzmue.py new file mode 100644 index 0000000000000000000000000000000000000000..1eb74b920fcbdf05c120f9ecf87e30d31b201caa --- /dev/null +++ b/.inductor_cache/o6/co6hyomcl3npwceolu64q5bdvrb7h6qa4h3fycnlkntxzzmdzmue.py @@ -0,0 +1,24 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 65536}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*bf16', 'out_ptr0': '*bf16', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=3, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 294912}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x2 = xindex + tmp0 = tl.load(in_ptr0 + (x2), xmask, eviction_policy='evict_last').to(tl.float32) + tl.store(out_ptr0 + (x2), tmp0, xmask) diff --git a/.inductor_cache/o7/co77w4l7zmxloeh5boqtsf44o3xaivpu5nrtrg4n7x3bmt5nfod3.py b/.inductor_cache/o7/co77w4l7zmxloeh5boqtsf44o3xaivpu5nrtrg4n7x3bmt5nfod3.py new file mode 100644 index 0000000000000000000000000000000000000000..5e39f67fba57cc30b7bda828a6f71aca9d879521 --- /dev/null +++ b/.inductor_cache/o7/co77w4l7zmxloeh5boqtsf44o3xaivpu5nrtrg4n7x3bmt5nfod3.py @@ -0,0 +1,177 @@ +# AOT ID: ['0_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/lc/clcguzeiji37jwgntus444hj3afycp43fm5qx53rkl6toz6ywxve.py +# Topologically Sorted Source Nodes: [ge, lt, org_vocab_mask, ge_1, lt_1, added_vocab_mask, vocab_mask, mul, mul_1, valid_offset, sub_3, input_, invert], Original ATen: [aten.ge, aten.lt, aten.bitwise_and, aten.bitwise_or, aten.mul, aten.add, aten.sub, aten.bitwise_not] +# Source node to ATen node mapping: +# added_vocab_mask => bitwise_and_1 +# ge => ge +# ge_1 => ge_1 +# input_ => mul_6 +# invert => bitwise_not +# lt => lt +# lt_1 => lt_1 +# mul => mul +# mul_1 => mul_2 +# org_vocab_mask => bitwise_and +# sub_3 => sub_13 +# valid_offset => add_16 +# vocab_mask => bitwise_or +# Graph fragment: +# %arg1_1 : Tensor "i64[s15][1]cuda:2" = PlaceHolder[target=arg1_1] +# %ge : Tensor "b8[s15][1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.ge.Scalar](args = (%arg1_1, %arg2_1), kwargs = {}) +# %lt : Tensor "b8[s15][1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.lt.Scalar](args = (%arg1_1, %arg3_1), kwargs = {}) +# %bitwise_and : Tensor "b8[s15][1]cuda:2"[num_users=2] = call_function[target=torch.ops.aten.bitwise_and.Tensor](args = (%ge, %lt), kwargs = {}) +# %ge_1 : Tensor "b8[s15][1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.ge.Scalar](args = (%arg1_1, %arg4_1), kwargs = {}) +# %lt_1 : Tensor "b8[s15][1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.lt.Scalar](args = (%arg1_1, %arg5_1), kwargs = {}) +# %bitwise_and_1 : Tensor "b8[s15][1]cuda:2"[num_users=2] = call_function[target=torch.ops.aten.bitwise_and.Tensor](args = (%ge_1, %lt_1), kwargs = {}) +# %bitwise_or : Tensor "b8[s15][1]cuda:2"[num_users=2] = call_function[target=torch.ops.aten.bitwise_or.Tensor](args = (%bitwise_and, %bitwise_and_1), kwargs = {}) +# %mul : Tensor "i64[s15][1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%bitwise_and, %arg2_1), kwargs = {}) +# %mul_2 : Tensor "i64[s15][1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%bitwise_and_1, %sub_8), kwargs = {}) +# %add_16 : Tensor "i64[s15][1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%mul, %mul_2), kwargs = {}) +# %sub_13 : Tensor "i64[s15][1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%arg1_1, %add_16), kwargs = {}) +# %mul_6 : Tensor "i64[s15][1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%bitwise_or, %sub_13), kwargs = {}) +# %bitwise_not : Tensor "b8[s15][1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.bitwise_not.default](args = (%bitwise_or,), kwargs = {}) +# return %mul_6,%bitwise_not +triton_poi_fused_add_bitwise_and_bitwise_not_bitwise_or_ge_lt_mul_sub_0 = async_compile.triton('triton_poi_fused_add_bitwise_and_bitwise_not_bitwise_or_ge_lt_mul_sub_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 128}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'out_ptr1': '*i1', 'ks0': 'i64', 'ks1': 'i64', 'ks2': 'i64', 'ks3': 'i64', 'ks4': 'i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=2, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_bitwise_and_bitwise_not_bitwise_or_ge_lt_mul_sub_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 2912}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_bitwise_and_bitwise_not_bitwise_or_ge_lt_mul_sub_0(in_ptr0, out_ptr0, out_ptr1, ks0, ks1, ks2, ks3, ks4, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = ks0 + tmp2 = tmp0 >= tmp1 + tmp3 = ks1 + tmp4 = tmp0 < tmp3 + tmp5 = tmp2 & tmp4 + tmp6 = ks2 + tmp7 = tmp0 >= tmp6 + tmp8 = ks3 + tmp9 = tmp0 < tmp8 + tmp10 = tmp7 & tmp9 + tmp11 = tmp5 | tmp10 + tmp12 = tmp11.to(tl.int64) + tmp13 = tmp5.to(tl.int64) + tmp14 = tmp13 * tmp1 + tmp15 = tmp10.to(tl.int64) + tmp16 = ks0 + ks2 + ((-1)*ks1) + ((-1)*ks4) + tmp17 = tmp15 * tmp16 + tmp18 = tmp14 + tmp17 + tmp19 = tmp0 - tmp18 + tmp20 = tmp12 * tmp19 + tmp21 = tmp11 == 0 + tl.store(out_ptr0 + (x0), tmp20, xmask) + tl.store(out_ptr1 + (x0), tmp21, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1 = args + args.clear() + s15 = arg0_1 + s90 = arg2_1 + s87 = arg3_1 + s68 = arg4_1 + s53 = arg5_1 + s88 = arg6_1 + assert_size_stride(arg1_1, (s15, ), (1, )) + with torch.cuda._DeviceGuard(2): + torch.cuda.set_device(2) + buf0 = empty_strided_cuda((s15, ), (1, ), torch.int64) + buf1 = empty_strided_cuda((s15, ), (1, ), torch.bool) + # Topologically Sorted Source Nodes: [ge, lt, org_vocab_mask, ge_1, lt_1, added_vocab_mask, vocab_mask, mul, mul_1, valid_offset, sub_3, input_, invert], Original ATen: [aten.ge, aten.lt, aten.bitwise_and, aten.bitwise_or, aten.mul, aten.add, aten.sub, aten.bitwise_not] + stream2 = get_raw_stream(2) + triton_poi_fused_add_bitwise_and_bitwise_not_bitwise_or_ge_lt_mul_sub_0.run(arg1_1, buf0, buf1, s90, s87, s68, s53, s88, s15, stream=stream2) + del arg1_1 + return (buf0, buf1, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = 112 + arg1_1 = rand_strided((112, ), (1, ), device='cuda:2', dtype=torch.int64) + arg2_1 = 38720 + arg3_1 = 58080 + arg4_1 = 154880 + arg5_1 = 154880 + arg6_1 = 0 + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/og/cogpp44qciopvbt3oa557mjtynfveombyw3vzj4pg577kyobjm5t.py b/.inductor_cache/og/cogpp44qciopvbt3oa557mjtynfveombyw3vzj4pg577kyobjm5t.py new file mode 100644 index 0000000000000000000000000000000000000000..5ead1918a5e83f2e6560a9674bf21f295baa3afb --- /dev/null +++ b/.inductor_cache/og/cogpp44qciopvbt3oa557mjtynfveombyw3vzj4pg577kyobjm5t.py @@ -0,0 +1,177 @@ +# AOT ID: ['0_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/bz/cbzzqys3m7e3fezpt6s47xyjuhnxe5ckvl7zn6swjd64ovsqzy3u.py +# Topologically Sorted Source Nodes: [ge, lt, org_vocab_mask, ge_1, lt_1, added_vocab_mask, vocab_mask, mul, mul_1, valid_offset, sub_3, input_, invert], Original ATen: [aten.ge, aten.lt, aten.bitwise_and, aten.bitwise_or, aten.mul, aten.add, aten.sub, aten.bitwise_not] +# Source node to ATen node mapping: +# added_vocab_mask => bitwise_and_1 +# ge => ge +# ge_1 => ge_1 +# input_ => mul_6 +# invert => bitwise_not +# lt => lt +# lt_1 => lt_1 +# mul => mul +# mul_1 => mul_2 +# org_vocab_mask => bitwise_and +# sub_3 => sub_13 +# valid_offset => add_16 +# vocab_mask => bitwise_or +# Graph fragment: +# %arg1_1 : Tensor "i64[s15][1]cuda:6" = PlaceHolder[target=arg1_1] +# %ge : Tensor "b8[s15][1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.ge.Scalar](args = (%arg1_1, %arg2_1), kwargs = {}) +# %lt : Tensor "b8[s15][1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.lt.Scalar](args = (%arg1_1, %arg3_1), kwargs = {}) +# %bitwise_and : Tensor "b8[s15][1]cuda:6"[num_users=2] = call_function[target=torch.ops.aten.bitwise_and.Tensor](args = (%ge, %lt), kwargs = {}) +# %ge_1 : Tensor "b8[s15][1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.ge.Scalar](args = (%arg1_1, %arg4_1), kwargs = {}) +# %lt_1 : Tensor "b8[s15][1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.lt.Scalar](args = (%arg1_1, %arg5_1), kwargs = {}) +# %bitwise_and_1 : Tensor "b8[s15][1]cuda:6"[num_users=2] = call_function[target=torch.ops.aten.bitwise_and.Tensor](args = (%ge_1, %lt_1), kwargs = {}) +# %bitwise_or : Tensor "b8[s15][1]cuda:6"[num_users=2] = call_function[target=torch.ops.aten.bitwise_or.Tensor](args = (%bitwise_and, %bitwise_and_1), kwargs = {}) +# %mul : Tensor "i64[s15][1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%bitwise_and, %arg2_1), kwargs = {}) +# %mul_2 : Tensor "i64[s15][1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%bitwise_and_1, %sub_8), kwargs = {}) +# %add_16 : Tensor "i64[s15][1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%mul, %mul_2), kwargs = {}) +# %sub_13 : Tensor "i64[s15][1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%arg1_1, %add_16), kwargs = {}) +# %mul_6 : Tensor "i64[s15][1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%bitwise_or, %sub_13), kwargs = {}) +# %bitwise_not : Tensor "b8[s15][1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.bitwise_not.default](args = (%bitwise_or,), kwargs = {}) +# return %mul_6,%bitwise_not +triton_poi_fused_add_bitwise_and_bitwise_not_bitwise_or_ge_lt_mul_sub_0 = async_compile.triton('triton_poi_fused_add_bitwise_and_bitwise_not_bitwise_or_ge_lt_mul_sub_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 128}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'out_ptr1': '*i1', 'ks0': 'i64', 'ks1': 'i64', 'ks2': 'i64', 'ks3': 'i64', 'ks4': 'i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=6, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_bitwise_and_bitwise_not_bitwise_or_ge_lt_mul_sub_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 2912}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_bitwise_and_bitwise_not_bitwise_or_ge_lt_mul_sub_0(in_ptr0, out_ptr0, out_ptr1, ks0, ks1, ks2, ks3, ks4, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = ks0 + tmp2 = tmp0 >= tmp1 + tmp3 = ks1 + tmp4 = tmp0 < tmp3 + tmp5 = tmp2 & tmp4 + tmp6 = ks2 + tmp7 = tmp0 >= tmp6 + tmp8 = ks3 + tmp9 = tmp0 < tmp8 + tmp10 = tmp7 & tmp9 + tmp11 = tmp5 | tmp10 + tmp12 = tmp11.to(tl.int64) + tmp13 = tmp5.to(tl.int64) + tmp14 = tmp13 * tmp1 + tmp15 = tmp10.to(tl.int64) + tmp16 = ks0 + ks2 + ((-1)*ks1) + ((-1)*ks4) + tmp17 = tmp15 * tmp16 + tmp18 = tmp14 + tmp17 + tmp19 = tmp0 - tmp18 + tmp20 = tmp12 * tmp19 + tmp21 = tmp11 == 0 + tl.store(out_ptr0 + (x0), tmp20, xmask) + tl.store(out_ptr1 + (x0), tmp21, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1 = args + args.clear() + s15 = arg0_1 + s90 = arg2_1 + s87 = arg3_1 + s68 = arg4_1 + s53 = arg5_1 + s88 = arg6_1 + assert_size_stride(arg1_1, (s15, ), (1, )) + with torch.cuda._DeviceGuard(6): + torch.cuda.set_device(6) + buf0 = empty_strided_cuda((s15, ), (1, ), torch.int64) + buf1 = empty_strided_cuda((s15, ), (1, ), torch.bool) + # Topologically Sorted Source Nodes: [ge, lt, org_vocab_mask, ge_1, lt_1, added_vocab_mask, vocab_mask, mul, mul_1, valid_offset, sub_3, input_, invert], Original ATen: [aten.ge, aten.lt, aten.bitwise_and, aten.bitwise_or, aten.mul, aten.add, aten.sub, aten.bitwise_not] + stream6 = get_raw_stream(6) + triton_poi_fused_add_bitwise_and_bitwise_not_bitwise_or_ge_lt_mul_sub_0.run(arg1_1, buf0, buf1, s90, s87, s68, s53, s88, s15, stream=stream6) + del arg1_1 + return (buf0, buf1, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = 112 + arg1_1 = rand_strided((112, ), (1, ), device='cuda:6', dtype=torch.int64) + arg2_1 = 116160 + arg3_1 = 135520 + arg4_1 = 154880 + arg5_1 = 154880 + arg6_1 = 0 + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/og/cogs4h3zsdai5pwcgdyg2qpo7aqwzxuy5pihw5erpyfjllq3gb6k.py b/.inductor_cache/og/cogs4h3zsdai5pwcgdyg2qpo7aqwzxuy5pihw5erpyfjllq3gb6k.py new file mode 100644 index 0000000000000000000000000000000000000000..8002f348709b8fd8eb4b752dc8a541d5b86af629 --- /dev/null +++ b/.inductor_cache/og/cogs4h3zsdai5pwcgdyg2qpo7aqwzxuy5pihw5erpyfjllq3gb6k.py @@ -0,0 +1,129 @@ +# AOT ID: ['4_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/ka/cka2o67gzlydxyz2setxkrfr6kb64dtelf3qrrwl5cwfxy56esqx.py +# Topologically Sorted Source Nodes: [weights_1], Original ATen: [aten.mul] +# Source node to ATen node mapping: +# weights_1 => mul_2 +# Graph fragment: +# %mm : Tensor "f32[s77, 32][32, 1]cuda:3" = PlaceHolder[target=mm] +# %mul_2 : Tensor "f32[s77, 32][32, 1]cuda:3"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mm, 0.1767766952966369), kwargs = {}) +# return %mul_2 +triton_poi_fused_mul_0 = async_compile.triton('triton_poi_fused_mul_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 256}, + filename=__file__, + triton_meta={'signature': {'in_out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=3, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_0', 'mutated_arg_names': ['in_out_ptr0'], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 3072}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_0(in_out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_out_ptr0 + (x0), xmask) + tmp1 = tl.full([1], 0.1767766952966369, tl.float32) + tmp2 = tmp0 * tmp1 + tl.store(in_out_ptr0 + (x0), tmp2, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1 = args + args.clear() + s77 = arg1_1 + assert_size_stride(arg0_1, (32, 6144), (6144, 1)) + assert_size_stride(arg2_1, (s77, 6144), (6144, 1)) + with torch.cuda._DeviceGuard(3): + torch.cuda.set_device(3) + buf0 = empty_strided_cuda((s77, 32), (32, 1), torch.float32) + # Topologically Sorted Source Nodes: [t, weights], Original ATen: [aten.t, aten.mm] + extern_kernels.mm_dtype(arg2_1, reinterpret_tensor(arg0_1, (6144, 32), (1, 6144), 0), out_dtype=torch.float32, out=buf0) + del arg0_1 + del arg2_1 + buf1 = buf0; del buf0 # reuse + # Topologically Sorted Source Nodes: [weights_1], Original ATen: [aten.mul] + triton_poi_fused_mul_0_xnumel = 32*s77 + stream3 = get_raw_stream(3) + triton_poi_fused_mul_0.run(buf1, triton_poi_fused_mul_0_xnumel, stream=stream3) + return (buf1, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = rand_strided((32, 6144), (6144, 1), device='cuda:3', dtype=torch.bfloat16) + arg1_1 = 8 + arg2_1 = rand_strided((8, 6144), (6144, 1), device='cuda:3', dtype=torch.bfloat16) + return [arg0_1, arg1_1, arg2_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/on/con2co4k7w52qg66v2zqslof42jwcyhhekfpzlinwiye2yqknxq6.py b/.inductor_cache/on/con2co4k7w52qg66v2zqslof42jwcyhhekfpzlinwiye2yqknxq6.py new file mode 100644 index 0000000000000000000000000000000000000000..5f00a6d5ad99fb18960bf9cd092941d4a00825e5 --- /dev/null +++ b/.inductor_cache/on/con2co4k7w52qg66v2zqslof42jwcyhhekfpzlinwiye2yqknxq6.py @@ -0,0 +1,291 @@ +# AOT ID: ['7_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/pq/cpqfafvbzdc4yv5hpjbitcl5zsctcve7hn6ahg66aj4blq3vprf6.py +# Topologically Sorted Source Nodes: [unsqueeze, view, expand_scores, flatten, max_1], Original ATen: [aten.unsqueeze, aten.view, aten.mul, aten.max] +# Source node to ATen node mapping: +# expand_scores => mul_3 +# flatten => view_1 +# max_1 => getitem, max_1 +# unsqueeze => unsqueeze +# view => view +# Graph fragment: +# %arg2_1 : Tensor "f32[s0, 1][1, 1]cuda:5" = PlaceHolder[target=arg2_1] +# %arg4_1 : Tensor "f32[s0, 1][1, 1]cuda:5" = PlaceHolder[target=arg4_1] +# %mul_3 : Tensor "f32[s0, 1, 1][1, 1, 1]cuda:5" = PlaceHolder[target=mul_3] +# %unsqueeze : Tensor "f32[s0, 1, 1][1, 1, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%arg2_1, 2), kwargs = {}) +# %view : Tensor "f32[s0, 1, 1][1, 1, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%arg4_1, [-1, 1, 1]), kwargs = {}) +# %mul_3 : Tensor "f32[s0, 1, 1][1, 1, 1]cuda:5"[num_users=2] = call_function[target=torch.ops.aten.mul.Tensor](args = (%unsqueeze, %view), kwargs = {}) +# %view_1 : Tensor "f32[s0, 1][1, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg3_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %getitem : Tensor "f32[s0, 1][1, 1]cuda:5"[num_users=1] = call_function[target=operator.getitem](args = (%max_1, 0), kwargs = {}) +# return %mul_3,%getitem +triton_poi_fused_max_mul_unsqueeze_view_0 = async_compile.triton('triton_poi_fused_max_mul_unsqueeze_view_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'out_ptr0': '*fp32', 'out_ptr1': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=5, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_max_mul_unsqueeze_view_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 2, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 192}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_max_mul_unsqueeze_view_0(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp2 = tmp0 * tmp1 + tl.store(out_ptr0 + (x0), tmp2, xmask) + tl.store(out_ptr1 + (x0), tmp2, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/zb/czbs2fm46j6qhtd2znnofgeavkuhyl72vdcahggz7dhvxp5zvnma.py +# Topologically Sorted Source Nodes: [flatten, max_1, gather], Original ATen: [aten.view, aten.max, aten.gather] +# Source node to ATen node mapping: +# flatten => view_1 +# gather => gather +# max_1 => max_1 +# Graph fragment: +# %arg5_1 : Tensor "i64[s0, 1][1, 1]cuda:5" = PlaceHolder[target=arg5_1] +# %view_1 : Tensor "f32[s0, 1][1, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg3_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %gather : Tensor "i64[s0, 1][1, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.gather.default](args = (%arg5_1, 1, %getitem_1), kwargs = {}) +# return %gather +triton_poi_fused_gather_max_view_1 = async_compile.triton('triton_poi_fused_gather_max_view_1', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=5, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_gather_max_view_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 192}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_gather_max_view_1(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tl.store(out_ptr0 + (x0), tmp0, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/zm/czmqgy6soqztyipifu6p2jfwi4je2rv5dgpxsqvvy3vdykavyemd.py +# Topologically Sorted Source Nodes: [flatten, max_1, flat_cs, floordiv, batch_offsets, repeat_interleave, selected_input_index, hidden_states], Original ATen: [aten.view, aten.max, aten.floor_divide, aten.arange, aten.unsqueeze, aten.add, aten.index] +# Source node to ATen node mapping: +# batch_offsets => iota +# flat_cs => view_4 +# flatten => view_1 +# floordiv => div +# hidden_states => index +# max_1 => max_1 +# repeat_interleave => unsqueeze_1, view_5 +# selected_input_index => add_47 +# Graph fragment: +# %arg7_1 : Tensor "bf16[s0, s87][s87, 1]cuda:5" = PlaceHolder[target=arg7_1] +# %view_1 : Tensor "f32[s0, 1][1, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg3_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %view_4 : Tensor "i64[s0][1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%getitem_1, [%arg3_1]), kwargs = {}) +# %div : Tensor "i64[s0][1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.div.Tensor_mode](args = (%view_4, 1), kwargs = {rounding_mode: floor}) +# %iota : Tensor "i64[s0][1]cuda:5"[num_users=1] = call_function[target=torch.ops.prims.iota.default](args = (%arg3_1,), kwargs = {start: 0, step: 1, dtype: torch.int64, device: cuda:5, requires_grad: False}) +# %unsqueeze_1 : Tensor "i64[s0, 1][1, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%iota, 1), kwargs = {}) +# %view_5 : Tensor "i64[s0][1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%expand, [%arg3_1]), kwargs = {}) +# %add_47 : Tensor "i64[s0][1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%div, %view_5), kwargs = {}) +# %index : Tensor "bf16[s0, s87][s87, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.index.Tensor](args = (%arg7_1, [%add_47]), kwargs = {}) +# return %index +triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2 = async_compile.triton('triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 65536}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*bf16', 'out_ptr0': '*bf16', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=5, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 294912}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x2 = xindex + tmp0 = tl.load(in_ptr0 + (x2), xmask, eviction_policy='evict_last').to(tl.float32) + tl.store(out_ptr0 + (x2), tmp0, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/mz/cmzyybpwh6qmtcq7gwcqgwbieukiskiqslaso7ig7lcotivioxzy.py +# Topologically Sorted Source Nodes: [flatten, max_1, add_2], Original ATen: [aten.view, aten.max, aten.add] +# Source node to ATen node mapping: +# add_2 => add_53 +# flatten => view_1 +# max_1 => max_1 +# Graph fragment: +# %view_1 : Tensor "f32[s0, 1][1, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg3_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %add_53 : Tensor "i64[s0, 1][1, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%getitem_1, %arg8_1), kwargs = {}) +# return %add_53 +triton_poi_fused_add_max_view_3 = async_compile.triton('triton_poi_fused_add_max_view_3', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8}, + filename=__file__, + triton_meta={'signature': {'out_ptr0': '*i64', 'ks0': 'i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=5, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_max_view_3', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 0, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 128}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_max_view_3(out_ptr0, ks0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = ks0 + tl.store(out_ptr0 + (x0), tmp0, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1, arg7_1, arg8_1 = args + args.clear() + s53 = arg0_1 + s68 = arg1_1 + s0 = arg3_1 + s87 = arg6_1 + s77 = arg8_1 + assert_size_stride(arg2_1, (s0, 1), (1, 1)) + assert_size_stride(arg4_1, (s0, 1), (1, 1)) + assert_size_stride(arg5_1, (s0, 1), (1, 1)) + assert_size_stride(arg7_1, (s0, s87), (s87, 1)) + with torch.cuda._DeviceGuard(5): + torch.cuda.set_device(5) + buf0 = empty_strided_cuda((s0, 1, 1), (1, 1, 1), torch.float32) + buf1 = empty_strided_cuda((s0, 1), (1, 1), torch.float32) + # Topologically Sorted Source Nodes: [unsqueeze, view, expand_scores, flatten, max_1], Original ATen: [aten.unsqueeze, aten.view, aten.mul, aten.max] + stream5 = get_raw_stream(5) + triton_poi_fused_max_mul_unsqueeze_view_0.run(arg2_1, arg4_1, buf0, buf1, s0, stream=stream5) + del arg2_1 + del arg4_1 + buf2 = empty_strided_cuda((s0, 1), (1, 1), torch.int64) + # Topologically Sorted Source Nodes: [flatten, max_1, gather], Original ATen: [aten.view, aten.max, aten.gather] + stream5 = get_raw_stream(5) + triton_poi_fused_gather_max_view_1.run(arg5_1, buf2, s0, stream=stream5) + buf3 = empty_strided_cuda((s0, s87), (s87, 1), torch.bfloat16) + # Topologically Sorted Source Nodes: [flatten, max_1, flat_cs, floordiv, batch_offsets, repeat_interleave, selected_input_index, hidden_states], Original ATen: [aten.view, aten.max, aten.floor_divide, aten.arange, aten.unsqueeze, aten.add, aten.index] + triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2_xnumel = s0*s87 + stream5 = get_raw_stream(5) + triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2.run(arg7_1, buf3, triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2_xnumel, stream=stream5) + del arg7_1 + buf4 = empty_strided_cuda((s0, 1), (1, 1), torch.int64) + # Topologically Sorted Source Nodes: [flatten, max_1, add_2], Original ATen: [aten.view, aten.max, aten.add] + stream5 = get_raw_stream(5) + triton_poi_fused_add_max_view_3.run(buf4, s77, s0, stream=stream5) + return (reinterpret_tensor(buf2, (s0, ), (1, ), 0), buf3, buf1, buf0, arg5_1, buf4, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = 1 + arg1_1 = 8 + arg2_1 = rand_strided((8, 1), (1, 1), device='cuda:5', dtype=torch.float32) + arg3_1 = 8 + arg4_1 = rand_strided((8, 1), (1, 1), device='cuda:5', dtype=torch.float32) + arg5_1 = rand_strided((8, 1), (1, 1), device='cuda:5', dtype=torch.int64) + arg6_1 = 6144 + arg7_1 = rand_strided((8, 6144), (6144, 1), device='cuda:5', dtype=torch.bfloat16) + arg8_1 = 2 + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1, arg7_1, arg8_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/oo/coozip2ovbcn7m7olgttp5v5i5njqohl22ntpfhn3ptuzbaux2jn.py b/.inductor_cache/oo/coozip2ovbcn7m7olgttp5v5i5njqohl22ntpfhn3ptuzbaux2jn.py new file mode 100644 index 0000000000000000000000000000000000000000..77b7b8cf79a8b831ca32a1fd66b4c6aff5cb7552 --- /dev/null +++ b/.inductor_cache/oo/coozip2ovbcn7m7olgttp5v5i5njqohl22ntpfhn3ptuzbaux2jn.py @@ -0,0 +1,27 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 32}, + filename=__file__, + triton_meta={'signature': {'in_out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=1, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_0', 'mutated_arg_names': ['in_out_ptr0'], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 384}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_0(in_out_ptr0, xnumel, XBLOCK : tl.constexpr): + xnumel = 32 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_out_ptr0 + (x0), xmask) + tmp1 = tl.full([1], 0.1767766952966369, tl.float32) + tmp2 = tmp0 * tmp1 + tl.store(in_out_ptr0 + (x0), tmp2, xmask) diff --git a/.inductor_cache/ou/coun2elkpvn3rcgj2cdbolwibmss6zt5jbhcgfbtpefuf5uwiqxo.py b/.inductor_cache/ou/coun2elkpvn3rcgj2cdbolwibmss6zt5jbhcgfbtpefuf5uwiqxo.py new file mode 100644 index 0000000000000000000000000000000000000000..a08552284f4a13d19804a21a6f9871d6219b73f5 --- /dev/null +++ b/.inductor_cache/ou/coun2elkpvn3rcgj2cdbolwibmss6zt5jbhcgfbtpefuf5uwiqxo.py @@ -0,0 +1,127 @@ +# AOT ID: ['9_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/nc/cnc5s3w6ila62i5yb57raw7vhphubcxtn2ptd46mlhpnp5o5f437.py +# Topologically Sorted Source Nodes: [weights_1], Original ATen: [aten.mul] +# Source node to ATen node mapping: +# weights_1 => mul +# Graph fragment: +# %mm : Tensor "f32[1, 32][32, 1]cuda:6" = PlaceHolder[target=mm] +# %mul : Tensor "f32[1, 32][32, 1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mm, 0.1767766952966369), kwargs = {}) +# return %mul +triton_poi_fused_mul_0 = async_compile.triton('triton_poi_fused_mul_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 32}, + filename=__file__, + triton_meta={'signature': {'in_out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=6, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_0', 'mutated_arg_names': ['in_out_ptr0'], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 384}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_0(in_out_ptr0, xnumel, XBLOCK : tl.constexpr): + xnumel = 32 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_out_ptr0 + (x0), xmask) + tmp1 = tl.full([1], 0.1767766952966369, tl.float32) + tmp2 = tmp0 * tmp1 + tl.store(in_out_ptr0 + (x0), tmp2, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1 = args + args.clear() + assert_size_stride(arg0_1, (32, 6144), (6144, 1)) + assert_size_stride(arg1_1, (1, 6144), (6144, 1)) + with torch.cuda._DeviceGuard(6): + torch.cuda.set_device(6) + buf0 = empty_strided_cuda((1, 32), (32, 1), torch.float32) + # Topologically Sorted Source Nodes: [t, weights], Original ATen: [aten.t, aten.mm] + extern_kernels.mm_dtype(arg1_1, reinterpret_tensor(arg0_1, (6144, 32), (1, 6144), 0), out_dtype=torch.float32, out=buf0) + del arg0_1 + del arg1_1 + buf1 = buf0; del buf0 # reuse + # Topologically Sorted Source Nodes: [weights_1], Original ATen: [aten.mul] + stream6 = get_raw_stream(6) + triton_poi_fused_mul_0.run(buf1, 32, stream=stream6) + return (buf1, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = rand_strided((32, 6144), (6144, 1), device='cuda:6', dtype=torch.bfloat16) + arg1_1 = rand_strided((1, 6144), (6144, 1), device='cuda:6', dtype=torch.bfloat16) + return [arg0_1, arg1_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/ow/67163b76a9e406985cd222e280a0a4a679604db25c00a44a1deaf5c70f818a26.best_config b/.inductor_cache/ow/67163b76a9e406985cd222e280a0a4a679604db25c00a44a1deaf5c70f818a26.best_config new file mode 100644 index 0000000000000000000000000000000000000000..99aa0fb830da51fbf73626185d4e469fcc477ff1 --- /dev/null +++ b/.inductor_cache/ow/67163b76a9e406985cd222e280a0a4a679604db25c00a44a1deaf5c70f818a26.best_config @@ -0,0 +1 @@ +{"XBLOCK": 256, "num_warps": 4, "num_stages": 1, "configs_hash": "1b2cc4dbebb9680d3ce31843331593b159e4046c056f195ca1ccf2464d5b37d1", "found_by_coordesc": false, "time_taken_ms": 47, "triton_cache_hash": "KGGY5WAIFCN23ENKRQFNT2OZB6CJLZGZIIMD5KHX6XAEJ3DEY7VA"} \ No newline at end of file diff --git a/.inductor_cache/ow/cowcazvvoa7gttairxhbhw44dttubnevj77lnql5q2t7v4x3qet2.py b/.inductor_cache/ow/cowcazvvoa7gttairxhbhw44dttubnevj77lnql5q2t7v4x3qet2.py new file mode 100644 index 0000000000000000000000000000000000000000..330bfa3fc67d90d5d4e74e3a47c1e2df789b690d --- /dev/null +++ b/.inductor_cache/ow/cowcazvvoa7gttairxhbhw44dttubnevj77lnql5q2t7v4x3qet2.py @@ -0,0 +1,31 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 2048}, + filename=__file__, + triton_meta={'signature': {'in_out_ptr0': '*fp32', 'in_ptr0': '*fp32', 'in_ptr1': 'fp64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=6, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_unsqueeze_0', 'mutated_arg_names': ['in_out_ptr0'], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 3, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 28672}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_unsqueeze_0(in_out_ptr0, in_ptr0, in_ptr1, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_out_ptr0 + (x0), xmask) + tmp3 = tl.load(in_ptr0 + (x0), xmask) + tmp5 = in_ptr1 + tmp1 = tl.full([1], 0.1767766952966369, tl.float32) + tmp2 = tmp0 * tmp1 + tmp4 = tmp2 * tmp3 + tmp6 = tmp5.to(tl.float32) + tmp7 = tmp4 * tmp6 + tl.store(in_out_ptr0 + (x0), tmp7, xmask) diff --git a/.inductor_cache/p6/cp6anlxymcodxplekldkj6kxkmylzo2ghk72fdfpizf42n2fyibe.py b/.inductor_cache/p6/cp6anlxymcodxplekldkj6kxkmylzo2ghk72fdfpizf42n2fyibe.py new file mode 100644 index 0000000000000000000000000000000000000000..96db6578c254f79bd2f0d1d7d901e01a557b54a1 --- /dev/null +++ b/.inductor_cache/p6/cp6anlxymcodxplekldkj6kxkmylzo2ghk72fdfpizf42n2fyibe.py @@ -0,0 +1,150 @@ +# AOT ID: ['3_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/ow/cowcazvvoa7gttairxhbhw44dttubnevj77lnql5q2t7v4x3qet2.py +# Topologically Sorted Source Nodes: [weights_1, unsqueeze, mul_1], Original ATen: [aten.mul, aten.unsqueeze] +# Source node to ATen node mapping: +# mul_1 => mul_7 +# unsqueeze => unsqueeze +# weights_1 => mul_2 +# Graph fragment: +# %mm : Tensor "f32[s0, 32][32, 1]cuda:6" = PlaceHolder[target=mm] +# %arg3_1 : Tensor "f32[s0, 32, 1][32, 1, 1]cuda:6" = PlaceHolder[target=arg3_1] +# %arg4_1 : Tensor "f64[][]cpu" = PlaceHolder[target=arg4_1] +# %mul_2 : Tensor "f32[s0, 32][32, 1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mm, 0.1767766952966369), kwargs = {}) +# %unsqueeze : Tensor "f32[s0, 32, 1][32, 1, 1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%mul_2, -1), kwargs = {}) +# %mul_7 : Tensor "f32[s0, 32, 1][32, 1, 1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%unsqueeze, %arg3_1), kwargs = {}) +# %convert_element_type_default_1 : Tensor "f32[][]cpu"[num_users=1] = call_function[target=torch.ops.prims.convert_element_type.default](args = (%arg4_1, torch.float32), kwargs = {}) +# %mul_tensor : Tensor "f32[s0, 32, 1][32, 1, 1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mul_7, %convert_element_type_default_1), kwargs = {}) +# return %mul_tensor +triton_poi_fused_mul_unsqueeze_0 = async_compile.triton('triton_poi_fused_mul_unsqueeze_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 2048}, + filename=__file__, + triton_meta={'signature': {'in_out_ptr0': '*fp32', 'in_ptr0': '*fp32', 'in_ptr1': 'fp64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=6, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_unsqueeze_0', 'mutated_arg_names': ['in_out_ptr0'], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 3, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 28672}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_unsqueeze_0(in_out_ptr0, in_ptr0, in_ptr1, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_out_ptr0 + (x0), xmask) + tmp3 = tl.load(in_ptr0 + (x0), xmask) + tmp5 = in_ptr1 + tmp1 = tl.full([1], 0.1767766952966369, tl.float32) + tmp2 = tmp0 * tmp1 + tmp4 = tmp2 * tmp3 + tmp6 = tmp5.to(tl.float32) + tmp7 = tmp4 * tmp6 + tl.store(in_out_ptr0 + (x0), tmp7, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1 = args + args.clear() + s77 = arg1_1 + arg2_1_size = arg2_1.size() + s0 = arg2_1_size[0] + assert_size_stride(arg0_1, (32, 6144), (6144, 1)) + assert_size_stride(arg2_1, (s0, 6144), (6144, 1)) + assert_size_stride(arg3_1, (s0, 32, 1), (32, 1, 1)) + assert_size_stride(arg4_1, (), ()) + with torch.cuda._DeviceGuard(6): + torch.cuda.set_device(6) + buf0 = empty_strided_cuda((s0, 32), (32, 1), torch.float32) + # Topologically Sorted Source Nodes: [t, weights], Original ATen: [aten.t, aten.mm] + extern_kernels.mm_dtype(arg2_1, reinterpret_tensor(arg0_1, (6144, 32), (1, 6144), 0), out_dtype=torch.float32, out=buf0) + del arg0_1 + del arg2_1 + buf1 = reinterpret_tensor(buf0, (s0, 32, 1), (32, 1, 1), 0); del buf0 # reuse + # Topologically Sorted Source Nodes: [weights_1, unsqueeze, mul_1], Original ATen: [aten.mul, aten.unsqueeze] + triton_poi_fused_mul_unsqueeze_0_xnumel = 32*s0 + stream6 = get_raw_stream(6) + triton_poi_fused_mul_unsqueeze_0.run(buf1, arg3_1, arg4_1.item(), triton_poi_fused_mul_unsqueeze_0_xnumel, stream=stream6) + del arg3_1 + del arg4_1 + return (buf1, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = rand_strided((32, 6144), (6144, 1), device='cuda:6', dtype=torch.bfloat16) + arg1_1 = 56 + arg2_1 = rand_strided((56, 6144), (6144, 1), device='cuda:6', dtype=torch.bfloat16) + arg3_1 = rand_strided((56, 32, 1), (32, 1, 1), device='cuda:6', dtype=torch.float32) + arg4_1 = rand_strided((), (), device='cpu', dtype=torch.float64) + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/pa/cpawzrdybha5gdq4fa5lo7tfdgmnc4oau2vm6vlwzcdoqqw3ho6x.py b/.inductor_cache/pa/cpawzrdybha5gdq4fa5lo7tfdgmnc4oau2vm6vlwzcdoqqw3ho6x.py new file mode 100644 index 0000000000000000000000000000000000000000..404d9745cd887eef406c438e23981b8c479bf41d --- /dev/null +++ b/.inductor_cache/pa/cpawzrdybha5gdq4fa5lo7tfdgmnc4oau2vm6vlwzcdoqqw3ho6x.py @@ -0,0 +1,289 @@ +# AOT ID: ['11_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/i2/ci252r34c4yo7p3rn2gomwr2yopckzpblszb4potci4h46c3vpof.py +# Topologically Sorted Source Nodes: [unsqueeze, view, expand_scores, flatten, max_1], Original ATen: [aten.unsqueeze, aten.view, aten.mul, aten.max] +# Source node to ATen node mapping: +# expand_scores => mul_1 +# flatten => view_1 +# max_1 => getitem, max_1 +# unsqueeze => unsqueeze +# view => view +# Graph fragment: +# %arg1_1 : Tensor "f32[1, 1][1, 1]cuda:2" = PlaceHolder[target=arg1_1] +# %arg2_1 : Tensor "f32[1, 1][1, 1]cuda:2" = PlaceHolder[target=arg2_1] +# %mul_1 : Tensor "f32[1, 1, 1][1, 1, 1]cuda:2" = PlaceHolder[target=mul_1] +# %unsqueeze : Tensor "f32[1, 1, 1][1, 1, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%arg1_1, 2), kwargs = {}) +# %view : Tensor "f32[1, 1, 1][1, 1, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%arg2_1, [-1, 1, 1]), kwargs = {}) +# %mul_1 : Tensor "f32[1, 1, 1][1, 1, 1]cuda:2"[num_users=2] = call_function[target=torch.ops.aten.mul.Tensor](args = (%unsqueeze, %view), kwargs = {}) +# %view_1 : Tensor "f32[1, 1][1, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_1, [1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %getitem : Tensor "f32[1, 1][1, 1]cuda:2"[num_users=1] = call_function[target=operator.getitem](args = (%max_1, 0), kwargs = {}) +# return %mul_1,%getitem +triton_poi_fused_max_mul_unsqueeze_view_0 = async_compile.triton('triton_poi_fused_max_mul_unsqueeze_view_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'out_ptr0': '*fp32', 'out_ptr1': '*fp32', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=2, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_max_mul_unsqueeze_view_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 2, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_max_mul_unsqueeze_view_0(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = tl.load(in_ptr0 + (0)) + tmp1 = tl.broadcast_to(tmp0, [XBLOCK]) + tmp2 = tl.load(in_ptr1 + (0)) + tmp3 = tl.broadcast_to(tmp2, [XBLOCK]) + tmp4 = tmp1 * tmp3 + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp4, None) + tl.store(out_ptr1 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp4, None) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/xz/cxzmtt3hhh5wwfwa27c6gr5pg3osr5ateew2wwxb765c4jlaevpr.py +# Topologically Sorted Source Nodes: [flatten, max_1, gather], Original ATen: [aten.view, aten.max, aten.gather] +# Source node to ATen node mapping: +# flatten => view_1 +# gather => gather +# max_1 => max_1 +# Graph fragment: +# %arg3_1 : Tensor "i64[1, 1][1, 1]cuda:2" = PlaceHolder[target=arg3_1] +# %view_1 : Tensor "f32[1, 1][1, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_1, [1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %gather : Tensor "i64[1, 1][1, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.gather.default](args = (%arg3_1, 1, %getitem_1), kwargs = {}) +# return %gather +triton_poi_fused_gather_max_view_1 = async_compile.triton('triton_poi_fused_gather_max_view_1', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=2, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_gather_max_view_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_gather_max_view_1(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = tl.load(in_ptr0 + (0)) + tmp1 = tl.broadcast_to(tmp0, [XBLOCK]) + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp1, None) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/lj/cljqnweqtkyp3ilstged43ibhg2lyswdikllklg47guwqhlww37r.py +# Topologically Sorted Source Nodes: [flatten, max_1, flat_cs, floordiv, batch_offsets, repeat_interleave, selected_input_index, hidden_states], Original ATen: [aten.view, aten.max, aten.floor_divide, aten.arange, aten.unsqueeze, aten.add, aten.index] +# Source node to ATen node mapping: +# batch_offsets => iota +# flat_cs => view_4 +# flatten => view_1 +# floordiv => div +# hidden_states => index +# max_1 => max_1 +# repeat_interleave => unsqueeze_1, view_5 +# selected_input_index => add +# Graph fragment: +# %arg5_1 : Tensor "bf16[1, s87][s87, 1]cuda:2" = PlaceHolder[target=arg5_1] +# %view_1 : Tensor "f32[1, 1][1, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_1, [1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %view_4 : Tensor "i64[1][1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%getitem_1, [1]), kwargs = {}) +# %div : Tensor "i64[1][1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.div.Tensor_mode](args = (%view_4, 1), kwargs = {rounding_mode: floor}) +# %iota : Tensor "i64[1][1]cuda:2"[num_users=1] = call_function[target=torch.ops.prims.iota.default](args = (1,), kwargs = {start: 0, step: 1, dtype: torch.int64, device: cuda:2, requires_grad: False}) +# %unsqueeze_1 : Tensor "i64[1, 1][1, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%iota, 1), kwargs = {}) +# %view_5 : Tensor "i64[1][1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%expand, [1]), kwargs = {}) +# %add : Tensor "i64[1][1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%div, %view_5), kwargs = {}) +# %index : Tensor "bf16[1, s87][s87, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.index.Tensor](args = (%arg5_1, [%add]), kwargs = {}) +# return %index +triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2 = async_compile.triton('triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8192}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*bf16', 'out_ptr0': '*bf16', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=2, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 36864}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask).to(tl.float32) + tl.store(out_ptr0 + (x0), tmp0, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/6u/c6uum37r4isrc4g6cyxmskeeex5jl3phh26m7xujcnuux4ijq3jw.py +# Topologically Sorted Source Nodes: [flatten, max_1, add_2], Original ATen: [aten.view, aten.max, aten.add] +# Source node to ATen node mapping: +# add_2 => add_3 +# flatten => view_1 +# max_1 => max_1 +# Graph fragment: +# %view_1 : Tensor "f32[1, 1][1, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_1, [1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %add_3 : Tensor "i64[1, 1][1, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%getitem_1, %arg6_1), kwargs = {}) +# return %add_3 +triton_poi_fused_add_max_view_3 = async_compile.triton('triton_poi_fused_add_max_view_3', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'out_ptr0': '*i64', 'ks0': 'i64', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=2, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_max_view_3', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 0, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_max_view_3(out_ptr0, ks0, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = ks0 + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32)), tmp0, None) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1 = args + args.clear() + s53 = arg0_1 + s87 = arg4_1 + s77 = arg6_1 + assert_size_stride(arg1_1, (1, 1), (1, 1)) + assert_size_stride(arg2_1, (1, 1), (1, 1)) + assert_size_stride(arg3_1, (1, 1), (1, 1)) + assert_size_stride(arg5_1, (1, s87), (s87, 1)) + with torch.cuda._DeviceGuard(2): + torch.cuda.set_device(2) + buf0 = empty_strided_cuda((1, 1, 1), (1, 1, 1), torch.float32) + buf1 = empty_strided_cuda((1, 1), (1, 1), torch.float32) + # Topologically Sorted Source Nodes: [unsqueeze, view, expand_scores, flatten, max_1], Original ATen: [aten.unsqueeze, aten.view, aten.mul, aten.max] + stream2 = get_raw_stream(2) + triton_poi_fused_max_mul_unsqueeze_view_0.run(arg1_1, arg2_1, buf0, buf1, 1, stream=stream2) + del arg1_1 + del arg2_1 + buf2 = empty_strided_cuda((1, 1), (1, 1), torch.int64) + # Topologically Sorted Source Nodes: [flatten, max_1, gather], Original ATen: [aten.view, aten.max, aten.gather] + stream2 = get_raw_stream(2) + triton_poi_fused_gather_max_view_1.run(arg3_1, buf2, 1, stream=stream2) + buf3 = empty_strided_cuda((1, s87), (s87, 1), torch.bfloat16) + # Topologically Sorted Source Nodes: [flatten, max_1, flat_cs, floordiv, batch_offsets, repeat_interleave, selected_input_index, hidden_states], Original ATen: [aten.view, aten.max, aten.floor_divide, aten.arange, aten.unsqueeze, aten.add, aten.index] + stream2 = get_raw_stream(2) + triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2.run(arg5_1, buf3, s87, stream=stream2) + del arg5_1 + buf4 = empty_strided_cuda((1, 1), (1, 1), torch.int64) + # Topologically Sorted Source Nodes: [flatten, max_1, add_2], Original ATen: [aten.view, aten.max, aten.add] + stream2 = get_raw_stream(2) + triton_poi_fused_add_max_view_3.run(buf4, s77, 1, stream=stream2) + return (reinterpret_tensor(buf2, (1, ), (1, ), 0), buf3, buf1, buf0, arg3_1, buf4, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = 1 + arg1_1 = rand_strided((1, 1), (1, 1), device='cuda:2', dtype=torch.float32) + arg2_1 = rand_strided((1, 1), (1, 1), device='cuda:2', dtype=torch.float32) + arg3_1 = rand_strided((1, 1), (1, 1), device='cuda:2', dtype=torch.int64) + arg4_1 = 6144 + arg5_1 = rand_strided((1, 6144), (6144, 1), device='cuda:2', dtype=torch.bfloat16) + arg6_1 = 1 + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/pf/cpfoff3tjmjwli33akk522guenhiraz7jxzrctbruncdtmoybdyq.py b/.inductor_cache/pf/cpfoff3tjmjwli33akk522guenhiraz7jxzrctbruncdtmoybdyq.py new file mode 100644 index 0000000000000000000000000000000000000000..ae246d97340d39ae6019300bbabe6162e97f0427 --- /dev/null +++ b/.inductor_cache/pf/cpfoff3tjmjwli33akk522guenhiraz7jxzrctbruncdtmoybdyq.py @@ -0,0 +1,27 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 32}, + filename=__file__, + triton_meta={'signature': {'in_out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=7, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_0', 'mutated_arg_names': ['in_out_ptr0'], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 384}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_0(in_out_ptr0, xnumel, XBLOCK : tl.constexpr): + xnumel = 32 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_out_ptr0 + (x0), xmask) + tmp1 = tl.full([1], 0.1767766952966369, tl.float32) + tmp2 = tmp0 * tmp1 + tl.store(in_out_ptr0 + (x0), tmp2, xmask) diff --git a/.inductor_cache/ph/493566b6b11c02faebd8696def008b861a36ef183c51fc189677b7c5195954d4.best_config b/.inductor_cache/ph/493566b6b11c02faebd8696def008b861a36ef183c51fc189677b7c5195954d4.best_config new file mode 100644 index 0000000000000000000000000000000000000000..ceb8ef25d450884e0fedce18ea088043d16dcf7f --- /dev/null +++ b/.inductor_cache/ph/493566b6b11c02faebd8696def008b861a36ef183c51fc189677b7c5195954d4.best_config @@ -0,0 +1 @@ +{"XBLOCK": 128, "num_warps": 4, "num_stages": 1, "configs_hash": "1b2cc4dbebb9680d3ce31843331593b159e4046c056f195ca1ccf2464d5b37d1", "found_by_coordesc": false, "time_taken_ms": 22, "triton_cache_hash": "Q2N5PO2YINGSELIO3M4VOOWLWHTNDJUQK2K7ETAZL7ECQK6GFLMA"} \ No newline at end of file diff --git a/.inductor_cache/ph/cphsftnfvqgyx6phk6pz33guvbz3xqjost5uerkyepgej7sakgm7.py b/.inductor_cache/ph/cphsftnfvqgyx6phk6pz33guvbz3xqjost5uerkyepgej7sakgm7.py new file mode 100644 index 0000000000000000000000000000000000000000..433bcdb86cd04d603746aaa78223f0d2247c2b1b --- /dev/null +++ b/.inductor_cache/ph/cphsftnfvqgyx6phk6pz33guvbz3xqjost5uerkyepgej7sakgm7.py @@ -0,0 +1,24 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 16384}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*bf16', 'out_ptr0': '*bf16', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=4, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 73728}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x2 = xindex + tmp0 = tl.load(in_ptr0 + (x2), xmask, eviction_policy='evict_last').to(tl.float32) + tl.store(out_ptr0 + (x2), tmp0, xmask) diff --git a/.inductor_cache/pk/8dc64e2efe238f3fa3fdcd80191675f26061e122939ab967b5c3b02206b23075.best_config b/.inductor_cache/pk/8dc64e2efe238f3fa3fdcd80191675f26061e122939ab967b5c3b02206b23075.best_config new file mode 100644 index 0000000000000000000000000000000000000000..7debf6347db5720350d12655809c5bf511f429e0 --- /dev/null +++ b/.inductor_cache/pk/8dc64e2efe238f3fa3fdcd80191675f26061e122939ab967b5c3b02206b23075.best_config @@ -0,0 +1 @@ +{"XBLOCK": 256, "num_warps": 4, "num_stages": 1, "configs_hash": "1b2cc4dbebb9680d3ce31843331593b159e4046c056f195ca1ccf2464d5b37d1", "found_by_coordesc": false, "time_taken_ms": 43, "triton_cache_hash": "KGGY5WAIFCN23ENKRQFNT2OZB6CJLZGZIIMD5KHX6XAEJ3DEY7VA"} \ No newline at end of file diff --git a/.inductor_cache/pk/cpkuzsuxmqb72c7wpmegqszo3sukl3dwc37k6of6ol25llfkezjy.py b/.inductor_cache/pk/cpkuzsuxmqb72c7wpmegqszo3sukl3dwc37k6of6ol25llfkezjy.py new file mode 100644 index 0000000000000000000000000000000000000000..c974056a839e49f318bf1105782696db30dba450 --- /dev/null +++ b/.inductor_cache/pk/cpkuzsuxmqb72c7wpmegqszo3sukl3dwc37k6of6ol25llfkezjy.py @@ -0,0 +1,31 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 2048}, + filename=__file__, + triton_meta={'signature': {'in_out_ptr0': '*fp32', 'in_ptr0': '*fp32', 'in_ptr1': 'fp64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=1, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_unsqueeze_0', 'mutated_arg_names': ['in_out_ptr0'], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 3, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 28672}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_unsqueeze_0(in_out_ptr0, in_ptr0, in_ptr1, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_out_ptr0 + (x0), xmask) + tmp3 = tl.load(in_ptr0 + (x0), xmask) + tmp5 = in_ptr1 + tmp1 = tl.full([1], 0.1767766952966369, tl.float32) + tmp2 = tmp0 * tmp1 + tmp4 = tmp2 * tmp3 + tmp6 = tmp5.to(tl.float32) + tmp7 = tmp4 * tmp6 + tl.store(in_out_ptr0 + (x0), tmp7, xmask) diff --git a/.inductor_cache/pn/cpner6uolczn44zhjl2hwjnpnblo3rw6gguet6a5o5ueqes2cfo7.py b/.inductor_cache/pn/cpner6uolczn44zhjl2hwjnpnblo3rw6gguet6a5o5ueqes2cfo7.py new file mode 100644 index 0000000000000000000000000000000000000000..b4b2d048cafb5c8d018fc00460096c38c1cf46d0 --- /dev/null +++ b/.inductor_cache/pn/cpner6uolczn44zhjl2hwjnpnblo3rw6gguet6a5o5ueqes2cfo7.py @@ -0,0 +1,24 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=4, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_gather_max_view_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 192}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_gather_max_view_1(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tl.store(out_ptr0 + (x0), tmp0, xmask) diff --git a/.inductor_cache/pp/cppse7vulhdxzhhgd4gt3zriyzmckncbynxijal5d3tuswhvlh24.py b/.inductor_cache/pp/cppse7vulhdxzhhgd4gt3zriyzmckncbynxijal5d3tuswhvlh24.py new file mode 100644 index 0000000000000000000000000000000000000000..b3d6b652e6f8de3188d6360ceeb9bc649153be15 --- /dev/null +++ b/.inductor_cache/pp/cppse7vulhdxzhhgd4gt3zriyzmckncbynxijal5d3tuswhvlh24.py @@ -0,0 +1,150 @@ +# AOT ID: ['3_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/nu/cnugnrk6jfhqwpdmpfwoftn2zrxw6uvqpkanjzekdnahjq2s2tts.py +# Topologically Sorted Source Nodes: [weights_1, unsqueeze, mul_1], Original ATen: [aten.mul, aten.unsqueeze] +# Source node to ATen node mapping: +# mul_1 => mul_7 +# unsqueeze => unsqueeze +# weights_1 => mul_2 +# Graph fragment: +# %mm : Tensor "f32[s0, 32][32, 1]cuda:0" = PlaceHolder[target=mm] +# %arg3_1 : Tensor "f32[s0, 32, 1][32, 1, 1]cuda:0" = PlaceHolder[target=arg3_1] +# %arg4_1 : Tensor "f64[][]cpu" = PlaceHolder[target=arg4_1] +# %mul_2 : Tensor "f32[s0, 32][32, 1]cuda:0"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mm, 0.1767766952966369), kwargs = {}) +# %unsqueeze : Tensor "f32[s0, 32, 1][32, 1, 1]cuda:0"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%mul_2, -1), kwargs = {}) +# %mul_7 : Tensor "f32[s0, 32, 1][32, 1, 1]cuda:0"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%unsqueeze, %arg3_1), kwargs = {}) +# %convert_element_type_default_1 : Tensor "f32[][]cpu"[num_users=1] = call_function[target=torch.ops.prims.convert_element_type.default](args = (%arg4_1, torch.float32), kwargs = {}) +# %mul_tensor : Tensor "f32[s0, 32, 1][32, 1, 1]cuda:0"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mul_7, %convert_element_type_default_1), kwargs = {}) +# return %mul_tensor +triton_poi_fused_mul_unsqueeze_0 = async_compile.triton('triton_poi_fused_mul_unsqueeze_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 2048}, + filename=__file__, + triton_meta={'signature': {'in_out_ptr0': '*fp32', 'in_ptr0': '*fp32', 'in_ptr1': 'fp64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=0, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_unsqueeze_0', 'mutated_arg_names': ['in_out_ptr0'], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 3, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 28672}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_unsqueeze_0(in_out_ptr0, in_ptr0, in_ptr1, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_out_ptr0 + (x0), xmask) + tmp3 = tl.load(in_ptr0 + (x0), xmask) + tmp5 = in_ptr1 + tmp1 = tl.full([1], 0.1767766952966369, tl.float32) + tmp2 = tmp0 * tmp1 + tmp4 = tmp2 * tmp3 + tmp6 = tmp5.to(tl.float32) + tmp7 = tmp4 * tmp6 + tl.store(in_out_ptr0 + (x0), tmp7, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1 = args + args.clear() + s77 = arg1_1 + arg2_1_size = arg2_1.size() + s0 = arg2_1_size[0] + assert_size_stride(arg0_1, (32, 6144), (6144, 1)) + assert_size_stride(arg2_1, (s0, 6144), (6144, 1)) + assert_size_stride(arg3_1, (s0, 32, 1), (32, 1, 1)) + assert_size_stride(arg4_1, (), ()) + with torch.cuda._DeviceGuard(0): + torch.cuda.set_device(0) + buf0 = empty_strided_cuda((s0, 32), (32, 1), torch.float32) + # Topologically Sorted Source Nodes: [t, weights], Original ATen: [aten.t, aten.mm] + extern_kernels.mm_dtype(arg2_1, reinterpret_tensor(arg0_1, (6144, 32), (1, 6144), 0), out_dtype=torch.float32, out=buf0) + del arg0_1 + del arg2_1 + buf1 = reinterpret_tensor(buf0, (s0, 32, 1), (32, 1, 1), 0); del buf0 # reuse + # Topologically Sorted Source Nodes: [weights_1, unsqueeze, mul_1], Original ATen: [aten.mul, aten.unsqueeze] + triton_poi_fused_mul_unsqueeze_0_xnumel = 32*s0 + stream0 = get_raw_stream(0) + triton_poi_fused_mul_unsqueeze_0.run(buf1, arg3_1, arg4_1.item(), triton_poi_fused_mul_unsqueeze_0_xnumel, stream=stream0) + del arg3_1 + del arg4_1 + return (buf1, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = rand_strided((32, 6144), (6144, 1), device='cuda:0', dtype=torch.bfloat16) + arg1_1 = 56 + arg2_1 = rand_strided((56, 6144), (6144, 1), device='cuda:0', dtype=torch.bfloat16) + arg3_1 = rand_strided((56, 32, 1), (32, 1, 1), device='cuda:0', dtype=torch.float32) + arg4_1 = rand_strided((), (), device='cpu', dtype=torch.float64) + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/pq/cpqfafvbzdc4yv5hpjbitcl5zsctcve7hn6ahg66aj4blq3vprf6.py b/.inductor_cache/pq/cpqfafvbzdc4yv5hpjbitcl5zsctcve7hn6ahg66aj4blq3vprf6.py new file mode 100644 index 0000000000000000000000000000000000000000..a7cda5499145e643de4930bc219941bdfea883f6 --- /dev/null +++ b/.inductor_cache/pq/cpqfafvbzdc4yv5hpjbitcl5zsctcve7hn6ahg66aj4blq3vprf6.py @@ -0,0 +1,27 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'out_ptr0': '*fp32', 'out_ptr1': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=5, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_max_mul_unsqueeze_view_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 2, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 192}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_max_mul_unsqueeze_view_0(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp2 = tmp0 * tmp1 + tl.store(out_ptr0 + (x0), tmp2, xmask) + tl.store(out_ptr1 + (x0), tmp2, xmask) diff --git a/.inductor_cache/qa/3f939b10ff486507bcd7cbe78f03fc9b9a84b13e7981cb84c24a4bfa743c29eb.best_config b/.inductor_cache/qa/3f939b10ff486507bcd7cbe78f03fc9b9a84b13e7981cb84c24a4bfa743c29eb.best_config new file mode 100644 index 0000000000000000000000000000000000000000..bfe3f8d2f7854ce195ee49a8736cc08ebde50dc4 --- /dev/null +++ b/.inductor_cache/qa/3f939b10ff486507bcd7cbe78f03fc9b9a84b13e7981cb84c24a4bfa743c29eb.best_config @@ -0,0 +1 @@ +{"XBLOCK": 128, "num_warps": 4, "num_stages": 1, "configs_hash": "1b2cc4dbebb9680d3ce31843331593b159e4046c056f195ca1ccf2464d5b37d1", "found_by_coordesc": false, "time_taken_ms": 31, "triton_cache_hash": "JO6EURS6OPPIJNQKRKLRTFGE6YEGGS4IKHEPZFQNLCS72U34VJOQ"} \ No newline at end of file diff --git a/.inductor_cache/qa/cqanpbkinyjt34of6jalwizrn65fcwlbt4ak3bptqfociplwus7q.py b/.inductor_cache/qa/cqanpbkinyjt34of6jalwizrn65fcwlbt4ak3bptqfociplwus7q.py new file mode 100644 index 0000000000000000000000000000000000000000..f1c9d5e6362f3fa4cee5385937bc8bb14ecd13e7 --- /dev/null +++ b/.inductor_cache/qa/cqanpbkinyjt34of6jalwizrn65fcwlbt4ak3bptqfociplwus7q.py @@ -0,0 +1,24 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8192}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*bf16', 'out_ptr0': '*bf16', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=1, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 36864}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask).to(tl.float32) + tl.store(out_ptr0 + (x0), tmp0, xmask) diff --git a/.inductor_cache/qd/cqdull3kwipr33yws7qnj6z4jsiuvue3qmvlqyhxb6q2tawpraqz.py b/.inductor_cache/qd/cqdull3kwipr33yws7qnj6z4jsiuvue3qmvlqyhxb6q2tawpraqz.py new file mode 100644 index 0000000000000000000000000000000000000000..a3521e320f6d21aa82a0fafefdd709866fcbd891 --- /dev/null +++ b/.inductor_cache/qd/cqdull3kwipr33yws7qnj6z4jsiuvue3qmvlqyhxb6q2tawpraqz.py @@ -0,0 +1,27 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 2}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'out_ptr0': '*fp32', 'out_ptr1': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=3, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_max_mul_unsqueeze_view_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 2, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 12}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_max_mul_unsqueeze_view_0(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp2 = tmp0 * tmp1 + tl.store(out_ptr0 + (x0), tmp2, xmask) + tl.store(out_ptr1 + (x0), tmp2, xmask) diff --git a/.inductor_cache/qn/cqngp72rsanfagungkc6ukdnhwo53f64ppwsabamr5pipvghq5pf.py b/.inductor_cache/qn/cqngp72rsanfagungkc6ukdnhwo53f64ppwsabamr5pipvghq5pf.py new file mode 100644 index 0000000000000000000000000000000000000000..8ea44712fc0310e4ce0236bc09fde3e74a5a534e --- /dev/null +++ b/.inductor_cache/qn/cqngp72rsanfagungkc6ukdnhwo53f64ppwsabamr5pipvghq5pf.py @@ -0,0 +1,142 @@ +# AOT ID: ['5_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/j5/cj5oje4hpl2s4bh465oo42uxpfb5opej5d4uifpm3xb2u3kphked.py +# Topologically Sorted Source Nodes: [unsqueeze, mul], Original ATen: [aten.unsqueeze, aten.mul] +# Source node to ATen node mapping: +# mul => mul_2 +# unsqueeze => unsqueeze +# Graph fragment: +# %arg2_1 : Tensor "f32[s0, s3][s3, 1]cuda:3" = PlaceHolder[target=arg2_1] +# %arg3_1 : Tensor "f32[s0, s3, 1][s3, 1, 1]cuda:3" = PlaceHolder[target=arg3_1] +# %arg4_1 : Tensor "f64[][]cpu" = PlaceHolder[target=arg4_1] +# %unsqueeze : Tensor "f32[s0, s3, 1][s3, 1, 1]cuda:3"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%arg2_1, -1), kwargs = {}) +# %mul_2 : Tensor "f32[s0, s3, 1][s3, 1, 1]cuda:3"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%unsqueeze, %arg3_1), kwargs = {}) +# %convert_element_type_default_1 : Tensor "f32[][]cpu"[num_users=1] = call_function[target=torch.ops.prims.convert_element_type.default](args = (%arg4_1, torch.float32), kwargs = {}) +# %mul_tensor : Tensor "f32[s0, s3, 1][s3, 1, 1]cuda:3"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mul_2, %convert_element_type_default_1), kwargs = {}) +# return %mul_tensor +triton_poi_fused_mul_unsqueeze_0 = async_compile.triton('triton_poi_fused_mul_unsqueeze_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 256}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'in_ptr2': 'fp64', 'out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=3, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_unsqueeze_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 3, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 4096}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_unsqueeze_0(in_ptr0, in_ptr1, in_ptr2, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp3 = in_ptr2 + tmp2 = tmp0 * tmp1 + tmp4 = tmp3.to(tl.float32) + tmp5 = tmp2 * tmp4 + tl.store(out_ptr0 + (x0), tmp5, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1 = args + args.clear() + s7 = arg0_1 + s3 = arg1_1 + arg2_1_size = arg2_1.size() + s0 = arg2_1_size[0] + assert_size_stride(arg2_1, (s0, s3), (s3, 1)) + assert_size_stride(arg3_1, (s0, s3, 1), (s3, 1, 1)) + assert_size_stride(arg4_1, (), ()) + with torch.cuda._DeviceGuard(3): + torch.cuda.set_device(3) + buf0 = empty_strided_cuda((s0, s3, 1), (s3, 1, 1), torch.float32) + # Topologically Sorted Source Nodes: [unsqueeze, mul], Original ATen: [aten.unsqueeze, aten.mul] + triton_poi_fused_mul_unsqueeze_0_xnumel = s0*s3 + stream3 = get_raw_stream(3) + triton_poi_fused_mul_unsqueeze_0.run(arg2_1, arg3_1, arg4_1.item(), buf0, triton_poi_fused_mul_unsqueeze_0_xnumel, stream=stream3) + del arg2_1 + del arg3_1 + del arg4_1 + return (buf0, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = 8 + arg1_1 = 32 + arg2_1 = rand_strided((8, 32), (32, 1), device='cuda:3', dtype=torch.float32) + arg3_1 = rand_strided((8, 32, 1), (32, 1, 1), device='cuda:3', dtype=torch.float32) + arg4_1 = rand_strided((), (), device='cpu', dtype=torch.float64) + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/qr/cqrzs74zvvz7hlzatzfs7e5cnsxsgddgs5vldxwpfrjrl73o4ykd.py b/.inductor_cache/qr/cqrzs74zvvz7hlzatzfs7e5cnsxsgddgs5vldxwpfrjrl73o4ykd.py new file mode 100644 index 0000000000000000000000000000000000000000..17dce8ad2b4edad3e1db65a7eea291c07d22e6a0 --- /dev/null +++ b/.inductor_cache/qr/cqrzs74zvvz7hlzatzfs7e5cnsxsgddgs5vldxwpfrjrl73o4ykd.py @@ -0,0 +1,177 @@ +# AOT ID: ['0_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/cv/ccvyvleabp5fpzrngpmfslbvg2l3duszy7jgnrfoy5wxfynxngvg.py +# Topologically Sorted Source Nodes: [ge, lt, org_vocab_mask, ge_1, lt_1, added_vocab_mask, vocab_mask, mul, mul_1, valid_offset, sub_3, input_, invert], Original ATen: [aten.ge, aten.lt, aten.bitwise_and, aten.bitwise_or, aten.mul, aten.add, aten.sub, aten.bitwise_not] +# Source node to ATen node mapping: +# added_vocab_mask => bitwise_and_1 +# ge => ge +# ge_1 => ge_1 +# input_ => mul_6 +# invert => bitwise_not +# lt => lt +# lt_1 => lt_1 +# mul => mul +# mul_1 => mul_2 +# org_vocab_mask => bitwise_and +# sub_3 => sub_13 +# valid_offset => add_16 +# vocab_mask => bitwise_or +# Graph fragment: +# %arg1_1 : Tensor "i64[s15][1]cuda:4" = PlaceHolder[target=arg1_1] +# %ge : Tensor "b8[s15][1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.ge.Scalar](args = (%arg1_1, %arg2_1), kwargs = {}) +# %lt : Tensor "b8[s15][1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.lt.Scalar](args = (%arg1_1, %arg3_1), kwargs = {}) +# %bitwise_and : Tensor "b8[s15][1]cuda:4"[num_users=2] = call_function[target=torch.ops.aten.bitwise_and.Tensor](args = (%ge, %lt), kwargs = {}) +# %ge_1 : Tensor "b8[s15][1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.ge.Scalar](args = (%arg1_1, %arg4_1), kwargs = {}) +# %lt_1 : Tensor "b8[s15][1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.lt.Scalar](args = (%arg1_1, %arg5_1), kwargs = {}) +# %bitwise_and_1 : Tensor "b8[s15][1]cuda:4"[num_users=2] = call_function[target=torch.ops.aten.bitwise_and.Tensor](args = (%ge_1, %lt_1), kwargs = {}) +# %bitwise_or : Tensor "b8[s15][1]cuda:4"[num_users=2] = call_function[target=torch.ops.aten.bitwise_or.Tensor](args = (%bitwise_and, %bitwise_and_1), kwargs = {}) +# %mul : Tensor "i64[s15][1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%bitwise_and, %arg2_1), kwargs = {}) +# %mul_2 : Tensor "i64[s15][1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%bitwise_and_1, %sub_8), kwargs = {}) +# %add_16 : Tensor "i64[s15][1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%mul, %mul_2), kwargs = {}) +# %sub_13 : Tensor "i64[s15][1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%arg1_1, %add_16), kwargs = {}) +# %mul_6 : Tensor "i64[s15][1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%bitwise_or, %sub_13), kwargs = {}) +# %bitwise_not : Tensor "b8[s15][1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.bitwise_not.default](args = (%bitwise_or,), kwargs = {}) +# return %mul_6,%bitwise_not +triton_poi_fused_add_bitwise_and_bitwise_not_bitwise_or_ge_lt_mul_sub_0 = async_compile.triton('triton_poi_fused_add_bitwise_and_bitwise_not_bitwise_or_ge_lt_mul_sub_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 128}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'out_ptr1': '*i1', 'ks0': 'i64', 'ks1': 'i64', 'ks2': 'i64', 'ks3': 'i64', 'ks4': 'i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=4, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_bitwise_and_bitwise_not_bitwise_or_ge_lt_mul_sub_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 2912}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_bitwise_and_bitwise_not_bitwise_or_ge_lt_mul_sub_0(in_ptr0, out_ptr0, out_ptr1, ks0, ks1, ks2, ks3, ks4, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = ks0 + tmp2 = tmp0 >= tmp1 + tmp3 = ks1 + tmp4 = tmp0 < tmp3 + tmp5 = tmp2 & tmp4 + tmp6 = ks2 + tmp7 = tmp0 >= tmp6 + tmp8 = ks3 + tmp9 = tmp0 < tmp8 + tmp10 = tmp7 & tmp9 + tmp11 = tmp5 | tmp10 + tmp12 = tmp11.to(tl.int64) + tmp13 = tmp5.to(tl.int64) + tmp14 = tmp13 * tmp1 + tmp15 = tmp10.to(tl.int64) + tmp16 = ks0 + ks2 + ((-1)*ks1) + ((-1)*ks4) + tmp17 = tmp15 * tmp16 + tmp18 = tmp14 + tmp17 + tmp19 = tmp0 - tmp18 + tmp20 = tmp12 * tmp19 + tmp21 = tmp11 == 0 + tl.store(out_ptr0 + (x0), tmp20, xmask) + tl.store(out_ptr1 + (x0), tmp21, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1 = args + args.clear() + s15 = arg0_1 + s90 = arg2_1 + s87 = arg3_1 + s68 = arg4_1 + s53 = arg5_1 + s88 = arg6_1 + assert_size_stride(arg1_1, (s15, ), (1, )) + with torch.cuda._DeviceGuard(4): + torch.cuda.set_device(4) + buf0 = empty_strided_cuda((s15, ), (1, ), torch.int64) + buf1 = empty_strided_cuda((s15, ), (1, ), torch.bool) + # Topologically Sorted Source Nodes: [ge, lt, org_vocab_mask, ge_1, lt_1, added_vocab_mask, vocab_mask, mul, mul_1, valid_offset, sub_3, input_, invert], Original ATen: [aten.ge, aten.lt, aten.bitwise_and, aten.bitwise_or, aten.mul, aten.add, aten.sub, aten.bitwise_not] + stream4 = get_raw_stream(4) + triton_poi_fused_add_bitwise_and_bitwise_not_bitwise_or_ge_lt_mul_sub_0.run(arg1_1, buf0, buf1, s90, s87, s68, s53, s88, s15, stream=stream4) + del arg1_1 + return (buf0, buf1, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = 112 + arg1_1 = rand_strided((112, ), (1, ), device='cuda:4', dtype=torch.int64) + arg2_1 = 77440 + arg3_1 = 96800 + arg4_1 = 154880 + arg5_1 = 154880 + arg6_1 = 0 + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/qu/cqug6f2ifg6ntmeel4nfny5jkpveadwrbxnei4coz4y46j2tjxar.py b/.inductor_cache/qu/cqug6f2ifg6ntmeel4nfny5jkpveadwrbxnei4coz4y46j2tjxar.py new file mode 100644 index 0000000000000000000000000000000000000000..9079386ed3fe1266fedff1bb6c65039115142348 --- /dev/null +++ b/.inductor_cache/qu/cqug6f2ifg6ntmeel4nfny5jkpveadwrbxnei4coz4y46j2tjxar.py @@ -0,0 +1,129 @@ +# AOT ID: ['4_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/hq/chq2yc37j736uphlh36y6ihrhpx4lv3n4jfqswgvzpbfdaqjm3nn.py +# Topologically Sorted Source Nodes: [weights_1], Original ATen: [aten.mul] +# Source node to ATen node mapping: +# weights_1 => mul_2 +# Graph fragment: +# %mm : Tensor "f32[s77, 32][32, 1]cuda:5" = PlaceHolder[target=mm] +# %mul_2 : Tensor "f32[s77, 32][32, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mm, 0.1767766952966369), kwargs = {}) +# return %mul_2 +triton_poi_fused_mul_0 = async_compile.triton('triton_poi_fused_mul_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 256}, + filename=__file__, + triton_meta={'signature': {'in_out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=5, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_0', 'mutated_arg_names': ['in_out_ptr0'], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 3072}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_0(in_out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_out_ptr0 + (x0), xmask) + tmp1 = tl.full([1], 0.1767766952966369, tl.float32) + tmp2 = tmp0 * tmp1 + tl.store(in_out_ptr0 + (x0), tmp2, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1 = args + args.clear() + s77 = arg1_1 + assert_size_stride(arg0_1, (32, 6144), (6144, 1)) + assert_size_stride(arg2_1, (s77, 6144), (6144, 1)) + with torch.cuda._DeviceGuard(5): + torch.cuda.set_device(5) + buf0 = empty_strided_cuda((s77, 32), (32, 1), torch.float32) + # Topologically Sorted Source Nodes: [t, weights], Original ATen: [aten.t, aten.mm] + extern_kernels.mm_dtype(arg2_1, reinterpret_tensor(arg0_1, (6144, 32), (1, 6144), 0), out_dtype=torch.float32, out=buf0) + del arg0_1 + del arg2_1 + buf1 = buf0; del buf0 # reuse + # Topologically Sorted Source Nodes: [weights_1], Original ATen: [aten.mul] + triton_poi_fused_mul_0_xnumel = 32*s77 + stream5 = get_raw_stream(5) + triton_poi_fused_mul_0.run(buf1, triton_poi_fused_mul_0_xnumel, stream=stream5) + return (buf1, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = rand_strided((32, 6144), (6144, 1), device='cuda:5', dtype=torch.bfloat16) + arg1_1 = 8 + arg2_1 = rand_strided((8, 6144), (6144, 1), device='cuda:5', dtype=torch.bfloat16) + return [arg0_1, arg1_1, arg2_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/qx/cqxc34ya4kqguntzj6n7xferfsinel33azpqqiacr6gbnn6q4rk3.py b/.inductor_cache/qx/cqxc34ya4kqguntzj6n7xferfsinel33azpqqiacr6gbnn6q4rk3.py new file mode 100644 index 0000000000000000000000000000000000000000..95e070c589f0364da687e616672cfe1e9f561bf4 --- /dev/null +++ b/.inductor_cache/qx/cqxc34ya4kqguntzj6n7xferfsinel33azpqqiacr6gbnn6q4rk3.py @@ -0,0 +1,150 @@ +# AOT ID: ['3_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/ak/cak6z2aw4nacwrl2y7z6ridytv56x6u4wfpx6eboacouj6q2iumn.py +# Topologically Sorted Source Nodes: [weights_1, unsqueeze, mul_1], Original ATen: [aten.mul, aten.unsqueeze] +# Source node to ATen node mapping: +# mul_1 => mul_7 +# unsqueeze => unsqueeze +# weights_1 => mul_2 +# Graph fragment: +# %mm : Tensor "f32[s0, 32][32, 1]cuda:5" = PlaceHolder[target=mm] +# %arg3_1 : Tensor "f32[s0, 32, 1][32, 1, 1]cuda:5" = PlaceHolder[target=arg3_1] +# %arg4_1 : Tensor "f64[][]cpu" = PlaceHolder[target=arg4_1] +# %mul_2 : Tensor "f32[s0, 32][32, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mm, 0.1767766952966369), kwargs = {}) +# %unsqueeze : Tensor "f32[s0, 32, 1][32, 1, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%mul_2, -1), kwargs = {}) +# %mul_7 : Tensor "f32[s0, 32, 1][32, 1, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%unsqueeze, %arg3_1), kwargs = {}) +# %convert_element_type_default_1 : Tensor "f32[][]cpu"[num_users=1] = call_function[target=torch.ops.prims.convert_element_type.default](args = (%arg4_1, torch.float32), kwargs = {}) +# %mul_tensor : Tensor "f32[s0, 32, 1][32, 1, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mul_7, %convert_element_type_default_1), kwargs = {}) +# return %mul_tensor +triton_poi_fused_mul_unsqueeze_0 = async_compile.triton('triton_poi_fused_mul_unsqueeze_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 2048}, + filename=__file__, + triton_meta={'signature': {'in_out_ptr0': '*fp32', 'in_ptr0': '*fp32', 'in_ptr1': 'fp64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=5, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_unsqueeze_0', 'mutated_arg_names': ['in_out_ptr0'], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 3, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 28672}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_unsqueeze_0(in_out_ptr0, in_ptr0, in_ptr1, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_out_ptr0 + (x0), xmask) + tmp3 = tl.load(in_ptr0 + (x0), xmask) + tmp5 = in_ptr1 + tmp1 = tl.full([1], 0.1767766952966369, tl.float32) + tmp2 = tmp0 * tmp1 + tmp4 = tmp2 * tmp3 + tmp6 = tmp5.to(tl.float32) + tmp7 = tmp4 * tmp6 + tl.store(in_out_ptr0 + (x0), tmp7, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1 = args + args.clear() + s77 = arg1_1 + arg2_1_size = arg2_1.size() + s0 = arg2_1_size[0] + assert_size_stride(arg0_1, (32, 6144), (6144, 1)) + assert_size_stride(arg2_1, (s0, 6144), (6144, 1)) + assert_size_stride(arg3_1, (s0, 32, 1), (32, 1, 1)) + assert_size_stride(arg4_1, (), ()) + with torch.cuda._DeviceGuard(5): + torch.cuda.set_device(5) + buf0 = empty_strided_cuda((s0, 32), (32, 1), torch.float32) + # Topologically Sorted Source Nodes: [t, weights], Original ATen: [aten.t, aten.mm] + extern_kernels.mm_dtype(arg2_1, reinterpret_tensor(arg0_1, (6144, 32), (1, 6144), 0), out_dtype=torch.float32, out=buf0) + del arg0_1 + del arg2_1 + buf1 = reinterpret_tensor(buf0, (s0, 32, 1), (32, 1, 1), 0); del buf0 # reuse + # Topologically Sorted Source Nodes: [weights_1, unsqueeze, mul_1], Original ATen: [aten.mul, aten.unsqueeze] + triton_poi_fused_mul_unsqueeze_0_xnumel = 32*s0 + stream5 = get_raw_stream(5) + triton_poi_fused_mul_unsqueeze_0.run(buf1, arg3_1, arg4_1.item(), triton_poi_fused_mul_unsqueeze_0_xnumel, stream=stream5) + del arg3_1 + del arg4_1 + return (buf1, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = rand_strided((32, 6144), (6144, 1), device='cuda:5', dtype=torch.bfloat16) + arg1_1 = 56 + arg2_1 = rand_strided((56, 6144), (6144, 1), device='cuda:5', dtype=torch.bfloat16) + arg3_1 = rand_strided((56, 32, 1), (32, 1, 1), device='cuda:5', dtype=torch.float32) + arg4_1 = rand_strided((), (), device='cpu', dtype=torch.float64) + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/r3/cr333mq2yzr7rixiiwaacpyfykcrh3oe4bimo3cngi42juonzohi.py b/.inductor_cache/r3/cr333mq2yzr7rixiiwaacpyfykcrh3oe4bimo3cngi42juonzohi.py new file mode 100644 index 0000000000000000000000000000000000000000..5965a0b54115596f5f2ea789408c42fff118cdb3 --- /dev/null +++ b/.inductor_cache/r3/cr333mq2yzr7rixiiwaacpyfykcrh3oe4bimo3cngi42juonzohi.py @@ -0,0 +1,27 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'out_ptr0': '*fp32', 'out_ptr1': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=1, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_max_mul_unsqueeze_view_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 2, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 192}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_max_mul_unsqueeze_view_0(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp2 = tmp0 * tmp1 + tl.store(out_ptr0 + (x0), tmp2, xmask) + tl.store(out_ptr1 + (x0), tmp2, xmask) diff --git a/.inductor_cache/r5/cr53e3b33x5ipsseng7l5za7ibpunvhbbo3dgdp6chmwh3xtywgg.py b/.inductor_cache/r5/cr53e3b33x5ipsseng7l5za7ibpunvhbbo3dgdp6chmwh3xtywgg.py new file mode 100644 index 0000000000000000000000000000000000000000..f480a87ce6b08a7c52a719a9cf21b2b9af1df62d --- /dev/null +++ b/.inductor_cache/r5/cr53e3b33x5ipsseng7l5za7ibpunvhbbo3dgdp6chmwh3xtywgg.py @@ -0,0 +1,45 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'ks0': 'i64', 'ks1': 'i64', 'ks2': 'i64', 'ks3': 'i64', 'ks4': 'i64', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=2, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_bitwise_and_bitwise_or_ge_lt_mul_sub_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_bitwise_and_bitwise_or_ge_lt_mul_sub_0(in_ptr0, out_ptr0, ks0, ks1, ks2, ks3, ks4, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = tl.load(in_ptr0 + (0)) + tmp1 = tl.broadcast_to(tmp0, [XBLOCK]) + tmp2 = ks0 + tmp3 = tmp1 >= tmp2 + tmp4 = ks1 + tmp5 = tmp1 < tmp4 + tmp6 = tmp3 & tmp5 + tmp7 = ks2 + tmp8 = tmp1 >= tmp7 + tmp9 = ks3 + tmp10 = tmp1 < tmp9 + tmp11 = tmp8 & tmp10 + tmp12 = tmp6 | tmp11 + tmp13 = tmp12.to(tl.int64) + tmp14 = tmp6.to(tl.int64) + tmp15 = tmp14 * tmp2 + tmp16 = tmp11.to(tl.int64) + tmp17 = ks0 + ks2 + ((-1)*ks1) + ((-1)*ks4) + tmp18 = tmp16 * tmp17 + tmp19 = tmp15 + tmp18 + tmp20 = tmp1 - tmp19 + tmp21 = tmp13 * tmp20 + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp21, None) diff --git a/.inductor_cache/r5/cr5stpc42p6e7gax2rhgvljylqkx5emjgqht2op5w5hwiihekryz.py b/.inductor_cache/r5/cr5stpc42p6e7gax2rhgvljylqkx5emjgqht2op5w5hwiihekryz.py new file mode 100644 index 0000000000000000000000000000000000000000..4661145c32c042133e05199d8cba0676e1436b58 --- /dev/null +++ b/.inductor_cache/r5/cr5stpc42p6e7gax2rhgvljylqkx5emjgqht2op5w5hwiihekryz.py @@ -0,0 +1,27 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'out_ptr0': '*fp32', 'out_ptr1': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=2, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_max_mul_unsqueeze_view_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 2, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 192}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_max_mul_unsqueeze_view_0(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp2 = tmp0 * tmp1 + tl.store(out_ptr0 + (x0), tmp2, xmask) + tl.store(out_ptr1 + (x0), tmp2, xmask) diff --git a/.inductor_cache/r5/cr5tbqtoljnas6jifxrgmcci7ci44iorwg4u4su5nvnsje73anqx.py b/.inductor_cache/r5/cr5tbqtoljnas6jifxrgmcci7ci44iorwg4u4su5nvnsje73anqx.py new file mode 100644 index 0000000000000000000000000000000000000000..2a0d2292c46ff4bb4afae27006d3683b3fb6178d --- /dev/null +++ b/.inductor_cache/r5/cr5tbqtoljnas6jifxrgmcci7ci44iorwg4u4su5nvnsje73anqx.py @@ -0,0 +1,289 @@ +# AOT ID: ['11_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/ym/cymwujume2azuvh7fbujnaekdocxf6szi57kpkkwcmuszidxouzv.py +# Topologically Sorted Source Nodes: [unsqueeze, view, expand_scores, flatten, max_1], Original ATen: [aten.unsqueeze, aten.view, aten.mul, aten.max] +# Source node to ATen node mapping: +# expand_scores => mul_1 +# flatten => view_1 +# max_1 => getitem, max_1 +# unsqueeze => unsqueeze +# view => view +# Graph fragment: +# %arg1_1 : Tensor "f32[1, 1][1, 1]cuda:3" = PlaceHolder[target=arg1_1] +# %arg2_1 : Tensor "f32[1, 1][1, 1]cuda:3" = PlaceHolder[target=arg2_1] +# %mul_1 : Tensor "f32[1, 1, 1][1, 1, 1]cuda:3" = PlaceHolder[target=mul_1] +# %unsqueeze : Tensor "f32[1, 1, 1][1, 1, 1]cuda:3"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%arg1_1, 2), kwargs = {}) +# %view : Tensor "f32[1, 1, 1][1, 1, 1]cuda:3"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%arg2_1, [-1, 1, 1]), kwargs = {}) +# %mul_1 : Tensor "f32[1, 1, 1][1, 1, 1]cuda:3"[num_users=2] = call_function[target=torch.ops.aten.mul.Tensor](args = (%unsqueeze, %view), kwargs = {}) +# %view_1 : Tensor "f32[1, 1][1, 1]cuda:3"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_1, [1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %getitem : Tensor "f32[1, 1][1, 1]cuda:3"[num_users=1] = call_function[target=operator.getitem](args = (%max_1, 0), kwargs = {}) +# return %mul_1,%getitem +triton_poi_fused_max_mul_unsqueeze_view_0 = async_compile.triton('triton_poi_fused_max_mul_unsqueeze_view_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'out_ptr0': '*fp32', 'out_ptr1': '*fp32', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=3, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_max_mul_unsqueeze_view_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 2, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_max_mul_unsqueeze_view_0(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = tl.load(in_ptr0 + (0)) + tmp1 = tl.broadcast_to(tmp0, [XBLOCK]) + tmp2 = tl.load(in_ptr1 + (0)) + tmp3 = tl.broadcast_to(tmp2, [XBLOCK]) + tmp4 = tmp1 * tmp3 + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp4, None) + tl.store(out_ptr1 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp4, None) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/3e/c3exb3qmzq5ev7yyxp6jzpk55mrxicwt5fjnjg72h4blbjqteq3b.py +# Topologically Sorted Source Nodes: [flatten, max_1, gather], Original ATen: [aten.view, aten.max, aten.gather] +# Source node to ATen node mapping: +# flatten => view_1 +# gather => gather +# max_1 => max_1 +# Graph fragment: +# %arg3_1 : Tensor "i64[1, 1][1, 1]cuda:3" = PlaceHolder[target=arg3_1] +# %view_1 : Tensor "f32[1, 1][1, 1]cuda:3"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_1, [1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %gather : Tensor "i64[1, 1][1, 1]cuda:3"[num_users=1] = call_function[target=torch.ops.aten.gather.default](args = (%arg3_1, 1, %getitem_1), kwargs = {}) +# return %gather +triton_poi_fused_gather_max_view_1 = async_compile.triton('triton_poi_fused_gather_max_view_1', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=3, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_gather_max_view_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_gather_max_view_1(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = tl.load(in_ptr0 + (0)) + tmp1 = tl.broadcast_to(tmp0, [XBLOCK]) + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp1, None) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/7y/c7yzfye2jf2x3hvi4ru7izthwntvroyxkirzlmtpopiyy2t6akxr.py +# Topologically Sorted Source Nodes: [flatten, max_1, flat_cs, floordiv, batch_offsets, repeat_interleave, selected_input_index, hidden_states], Original ATen: [aten.view, aten.max, aten.floor_divide, aten.arange, aten.unsqueeze, aten.add, aten.index] +# Source node to ATen node mapping: +# batch_offsets => iota +# flat_cs => view_4 +# flatten => view_1 +# floordiv => div +# hidden_states => index +# max_1 => max_1 +# repeat_interleave => unsqueeze_1, view_5 +# selected_input_index => add +# Graph fragment: +# %arg5_1 : Tensor "bf16[1, s87][s87, 1]cuda:3" = PlaceHolder[target=arg5_1] +# %view_1 : Tensor "f32[1, 1][1, 1]cuda:3"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_1, [1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %view_4 : Tensor "i64[1][1]cuda:3"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%getitem_1, [1]), kwargs = {}) +# %div : Tensor "i64[1][1]cuda:3"[num_users=1] = call_function[target=torch.ops.aten.div.Tensor_mode](args = (%view_4, 1), kwargs = {rounding_mode: floor}) +# %iota : Tensor "i64[1][1]cuda:3"[num_users=1] = call_function[target=torch.ops.prims.iota.default](args = (1,), kwargs = {start: 0, step: 1, dtype: torch.int64, device: cuda:3, requires_grad: False}) +# %unsqueeze_1 : Tensor "i64[1, 1][1, 1]cuda:3"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%iota, 1), kwargs = {}) +# %view_5 : Tensor "i64[1][1]cuda:3"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%expand, [1]), kwargs = {}) +# %add : Tensor "i64[1][1]cuda:3"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%div, %view_5), kwargs = {}) +# %index : Tensor "bf16[1, s87][s87, 1]cuda:3"[num_users=1] = call_function[target=torch.ops.aten.index.Tensor](args = (%arg5_1, [%add]), kwargs = {}) +# return %index +triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2 = async_compile.triton('triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8192}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*bf16', 'out_ptr0': '*bf16', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=3, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 36864}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask).to(tl.float32) + tl.store(out_ptr0 + (x0), tmp0, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/dc/cdcux4enrbootmatcwy52moflq3ec3gimeeqfqnnbs2rhdfegr4u.py +# Topologically Sorted Source Nodes: [flatten, max_1, add_2], Original ATen: [aten.view, aten.max, aten.add] +# Source node to ATen node mapping: +# add_2 => add_3 +# flatten => view_1 +# max_1 => max_1 +# Graph fragment: +# %view_1 : Tensor "f32[1, 1][1, 1]cuda:3"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_1, [1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %add_3 : Tensor "i64[1, 1][1, 1]cuda:3"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%getitem_1, %arg6_1), kwargs = {}) +# return %add_3 +triton_poi_fused_add_max_view_3 = async_compile.triton('triton_poi_fused_add_max_view_3', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'out_ptr0': '*i64', 'ks0': 'i64', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=3, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_max_view_3', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 0, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_max_view_3(out_ptr0, ks0, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = ks0 + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32)), tmp0, None) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1 = args + args.clear() + s53 = arg0_1 + s87 = arg4_1 + s77 = arg6_1 + assert_size_stride(arg1_1, (1, 1), (1, 1)) + assert_size_stride(arg2_1, (1, 1), (1, 1)) + assert_size_stride(arg3_1, (1, 1), (1, 1)) + assert_size_stride(arg5_1, (1, s87), (s87, 1)) + with torch.cuda._DeviceGuard(3): + torch.cuda.set_device(3) + buf0 = empty_strided_cuda((1, 1, 1), (1, 1, 1), torch.float32) + buf1 = empty_strided_cuda((1, 1), (1, 1), torch.float32) + # Topologically Sorted Source Nodes: [unsqueeze, view, expand_scores, flatten, max_1], Original ATen: [aten.unsqueeze, aten.view, aten.mul, aten.max] + stream3 = get_raw_stream(3) + triton_poi_fused_max_mul_unsqueeze_view_0.run(arg1_1, arg2_1, buf0, buf1, 1, stream=stream3) + del arg1_1 + del arg2_1 + buf2 = empty_strided_cuda((1, 1), (1, 1), torch.int64) + # Topologically Sorted Source Nodes: [flatten, max_1, gather], Original ATen: [aten.view, aten.max, aten.gather] + stream3 = get_raw_stream(3) + triton_poi_fused_gather_max_view_1.run(arg3_1, buf2, 1, stream=stream3) + buf3 = empty_strided_cuda((1, s87), (s87, 1), torch.bfloat16) + # Topologically Sorted Source Nodes: [flatten, max_1, flat_cs, floordiv, batch_offsets, repeat_interleave, selected_input_index, hidden_states], Original ATen: [aten.view, aten.max, aten.floor_divide, aten.arange, aten.unsqueeze, aten.add, aten.index] + stream3 = get_raw_stream(3) + triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2.run(arg5_1, buf3, s87, stream=stream3) + del arg5_1 + buf4 = empty_strided_cuda((1, 1), (1, 1), torch.int64) + # Topologically Sorted Source Nodes: [flatten, max_1, add_2], Original ATen: [aten.view, aten.max, aten.add] + stream3 = get_raw_stream(3) + triton_poi_fused_add_max_view_3.run(buf4, s77, 1, stream=stream3) + return (reinterpret_tensor(buf2, (1, ), (1, ), 0), buf3, buf1, buf0, arg3_1, buf4, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = 1 + arg1_1 = rand_strided((1, 1), (1, 1), device='cuda:3', dtype=torch.float32) + arg2_1 = rand_strided((1, 1), (1, 1), device='cuda:3', dtype=torch.float32) + arg3_1 = rand_strided((1, 1), (1, 1), device='cuda:3', dtype=torch.int64) + arg4_1 = 6144 + arg5_1 = rand_strided((1, 6144), (6144, 1), device='cuda:3', dtype=torch.bfloat16) + arg6_1 = 1 + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/r6/cr6a7je7lgurvwxlurfkudvnwwl26htjtvwwjxnv75jffqdxvgwj.py b/.inductor_cache/r6/cr6a7je7lgurvwxlurfkudvnwwl26htjtvwwjxnv75jffqdxvgwj.py new file mode 100644 index 0000000000000000000000000000000000000000..e2d64183d73987f340fb9d77df2f888052c4b5b7 --- /dev/null +++ b/.inductor_cache/r6/cr6a7je7lgurvwxlurfkudvnwwl26htjtvwwjxnv75jffqdxvgwj.py @@ -0,0 +1,29 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 32}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'in_ptr2': 'fp64', 'out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=5, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_unsqueeze_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 3, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 512}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_unsqueeze_0(in_ptr0, in_ptr1, in_ptr2, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp3 = in_ptr2 + tmp2 = tmp0 * tmp1 + tmp4 = tmp3.to(tl.float32) + tmp5 = tmp2 * tmp4 + tl.store(out_ptr0 + (x0), tmp5, xmask) diff --git a/.inductor_cache/rg/crg7nbmlqri3lyvws3zjp42an7bgasr6wnkl43z4dqhn2e22cdza.py b/.inductor_cache/rg/crg7nbmlqri3lyvws3zjp42an7bgasr6wnkl43z4dqhn2e22cdza.py new file mode 100644 index 0000000000000000000000000000000000000000..9a940401b17711ddcc7f7532e3e62150c8fb7156 --- /dev/null +++ b/.inductor_cache/rg/crg7nbmlqri3lyvws3zjp42an7bgasr6wnkl43z4dqhn2e22cdza.py @@ -0,0 +1,31 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 4096}, + filename=__file__, + triton_meta={'signature': {'in_out_ptr0': '*fp32', 'in_ptr0': '*fp32', 'in_ptr1': 'fp64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=6, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_unsqueeze_0', 'mutated_arg_names': ['in_out_ptr0'], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 3, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 57344}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_unsqueeze_0(in_out_ptr0, in_ptr0, in_ptr1, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_out_ptr0 + (x0), xmask) + tmp3 = tl.load(in_ptr0 + (x0), xmask) + tmp5 = in_ptr1 + tmp1 = tl.full([1], 0.1767766952966369, tl.float32) + tmp2 = tmp0 * tmp1 + tmp4 = tmp2 * tmp3 + tmp6 = tmp5.to(tl.float32) + tmp7 = tmp4 * tmp6 + tl.store(in_out_ptr0 + (x0), tmp7, xmask) diff --git a/.inductor_cache/rg/crgxj53suj2lbm2v2jhlg4x6zgxxvkmacxdzsula4efvajom2y4d.py b/.inductor_cache/rg/crgxj53suj2lbm2v2jhlg4x6zgxxvkmacxdzsula4efvajom2y4d.py new file mode 100644 index 0000000000000000000000000000000000000000..dc457ad00fe50502bb16216033be3cf017906d54 --- /dev/null +++ b/.inductor_cache/rg/crgxj53suj2lbm2v2jhlg4x6zgxxvkmacxdzsula4efvajom2y4d.py @@ -0,0 +1,26 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 256}, + filename=__file__, + triton_meta={'signature': {'in_out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=6, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_0', 'mutated_arg_names': ['in_out_ptr0'], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 3072}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_0(in_out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_out_ptr0 + (x0), xmask) + tmp1 = tl.full([1], 0.1767766952966369, tl.float32) + tmp2 = tmp0 * tmp1 + tl.store(in_out_ptr0 + (x0), tmp2, xmask) diff --git a/.inductor_cache/rg/db6eb14b6cc933599723c0dd3e55f560bf6eed797e4f395909a911a9242c8e89.best_config b/.inductor_cache/rg/db6eb14b6cc933599723c0dd3e55f560bf6eed797e4f395909a911a9242c8e89.best_config new file mode 100644 index 0000000000000000000000000000000000000000..c7c21b9a6ae7295164fe7d572997aec051a80fe2 --- /dev/null +++ b/.inductor_cache/rg/db6eb14b6cc933599723c0dd3e55f560bf6eed797e4f395909a911a9242c8e89.best_config @@ -0,0 +1 @@ +{"XBLOCK": 256, "num_warps": 4, "num_stages": 1, "configs_hash": "1b2cc4dbebb9680d3ce31843331593b159e4046c056f195ca1ccf2464d5b37d1", "found_by_coordesc": false, "time_taken_ms": 46, "triton_cache_hash": "KGGY5WAIFCN23ENKRQFNT2OZB6CJLZGZIIMD5KHX6XAEJ3DEY7VA"} \ No newline at end of file diff --git a/.inductor_cache/rg/e7b9f5d0c5d024a98371bd6a2c250454dbe88981ed89a46a9e0f18cf572263f8.best_config b/.inductor_cache/rg/e7b9f5d0c5d024a98371bd6a2c250454dbe88981ed89a46a9e0f18cf572263f8.best_config new file mode 100644 index 0000000000000000000000000000000000000000..544aabb45c6e30ded11046b351081fed919786ef --- /dev/null +++ b/.inductor_cache/rg/e7b9f5d0c5d024a98371bd6a2c250454dbe88981ed89a46a9e0f18cf572263f8.best_config @@ -0,0 +1 @@ +{"XBLOCK": 128, "num_warps": 4, "num_stages": 1, "configs_hash": "1b2cc4dbebb9680d3ce31843331593b159e4046c056f195ca1ccf2464d5b37d1", "found_by_coordesc": false, "time_taken_ms": 76, "triton_cache_hash": "LBOXSWDAX2GIZFOXRIZQ4S3246ZSKZAMDEVIL3FUHRGF3W6BJYLQ"} \ No newline at end of file diff --git a/.inductor_cache/rh/crhobtntezworhsvclhlo6xgjhdivblb7dtyucd6q6n3qtghp525.py b/.inductor_cache/rh/crhobtntezworhsvclhlo6xgjhdivblb7dtyucd6q6n3qtghp525.py new file mode 100644 index 0000000000000000000000000000000000000000..2ab748b54a2160a84d4791bdc8b1461508e46751 --- /dev/null +++ b/.inductor_cache/rh/crhobtntezworhsvclhlo6xgjhdivblb7dtyucd6q6n3qtghp525.py @@ -0,0 +1,29 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'out_ptr0': '*fp32', 'out_ptr1': '*fp32', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=6, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_max_mul_unsqueeze_view_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 2, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_max_mul_unsqueeze_view_0(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = tl.load(in_ptr0 + (0)) + tmp1 = tl.broadcast_to(tmp0, [XBLOCK]) + tmp2 = tl.load(in_ptr1 + (0)) + tmp3 = tl.broadcast_to(tmp2, [XBLOCK]) + tmp4 = tmp1 * tmp3 + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp4, None) + tl.store(out_ptr1 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp4, None) diff --git a/.inductor_cache/rl/crltwbaishol4iopibb6vgr7hpf646hjigovxhdihykrppm3ix4g.py b/.inductor_cache/rl/crltwbaishol4iopibb6vgr7hpf646hjigovxhdihykrppm3ix4g.py new file mode 100644 index 0000000000000000000000000000000000000000..a93a7de82908195a438250edb5fd8783cfe6d01a --- /dev/null +++ b/.inductor_cache/rl/crltwbaishol4iopibb6vgr7hpf646hjigovxhdihykrppm3ix4g.py @@ -0,0 +1,24 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8}, + filename=__file__, + triton_meta={'signature': {'out_ptr0': '*i64', 'ks0': 'i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=4, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_max_view_3', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 0, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 128}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_max_view_3(out_ptr0, ks0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = ks0 + tl.store(out_ptr0 + (x0), tmp0, xmask) diff --git a/.inductor_cache/ro/05107c8984409e24f1c338fa43343aa3b105a3641c527c779303fbcdf26c54ca.best_config b/.inductor_cache/ro/05107c8984409e24f1c338fa43343aa3b105a3641c527c779303fbcdf26c54ca.best_config new file mode 100644 index 0000000000000000000000000000000000000000..b3f296fbbd311093736dd17c59e1d11a6478f791 --- /dev/null +++ b/.inductor_cache/ro/05107c8984409e24f1c338fa43343aa3b105a3641c527c779303fbcdf26c54ca.best_config @@ -0,0 +1 @@ +{"XBLOCK": 256, "num_warps": 4, "num_stages": 1, "configs_hash": "7cced77f371acaa5aa7d90332a90e0c907727cfefb71d9cc9d997c24557fc44f", "found_by_coordesc": false, "time_taken_ms": 23, "triton_cache_hash": "QLXJTPJWIG7LHGEN76P7EYFUJIJLXLDECRO3I6NRHSQ4NBZC2KMA"} \ No newline at end of file diff --git a/.inductor_cache/ro/cround23pf4qaktlwffp3qcbjyrgot7o6kfowlbg2y4yepoaour2.py b/.inductor_cache/ro/cround23pf4qaktlwffp3qcbjyrgot7o6kfowlbg2y4yepoaour2.py new file mode 100644 index 0000000000000000000000000000000000000000..bb6e0e2931e1cf8e4b115f87eeae06617457d83b --- /dev/null +++ b/.inductor_cache/ro/cround23pf4qaktlwffp3qcbjyrgot7o6kfowlbg2y4yepoaour2.py @@ -0,0 +1,24 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 65536}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*bf16', 'out_ptr0': '*bf16', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=7, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 294912}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x2 = xindex + tmp0 = tl.load(in_ptr0 + (x2), xmask, eviction_policy='evict_last').to(tl.float32) + tl.store(out_ptr0 + (x2), tmp0, xmask) diff --git a/.inductor_cache/sf/csf3zztedhp5ggivmb2xxjvsf6g2j6norsgunvnqoyvmusjr3cse.py b/.inductor_cache/sf/csf3zztedhp5ggivmb2xxjvsf6g2j6norsgunvnqoyvmusjr3cse.py new file mode 100644 index 0000000000000000000000000000000000000000..39d1bd7c966415b98496dfb11f1943e739f10a01 --- /dev/null +++ b/.inductor_cache/sf/csf3zztedhp5ggivmb2xxjvsf6g2j6norsgunvnqoyvmusjr3cse.py @@ -0,0 +1,29 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 32}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'in_ptr2': 'fp64', 'out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=7, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_unsqueeze_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 3, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 512}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_unsqueeze_0(in_ptr0, in_ptr1, in_ptr2, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp3 = in_ptr2 + tmp2 = tmp0 * tmp1 + tmp4 = tmp3.to(tl.float32) + tmp5 = tmp2 * tmp4 + tl.store(out_ptr0 + (x0), tmp5, xmask) diff --git a/.inductor_cache/sl/89ec5e029e3fb010b1571218db7f0d3411948872a1626ada49af2a6f3b12d7cb.best_config b/.inductor_cache/sl/89ec5e029e3fb010b1571218db7f0d3411948872a1626ada49af2a6f3b12d7cb.best_config new file mode 100644 index 0000000000000000000000000000000000000000..0cd5c4297e38f38c2da3ed1f946f90cd6a32b6a7 --- /dev/null +++ b/.inductor_cache/sl/89ec5e029e3fb010b1571218db7f0d3411948872a1626ada49af2a6f3b12d7cb.best_config @@ -0,0 +1 @@ +{"XBLOCK": 128, "num_warps": 4, "num_stages": 1, "configs_hash": "1b2cc4dbebb9680d3ce31843331593b159e4046c056f195ca1ccf2464d5b37d1", "found_by_coordesc": false, "time_taken_ms": 38, "triton_cache_hash": "JO6EURS6OPPIJNQKRKLRTFGE6YEGGS4IKHEPZFQNLCS72U34VJOQ"} \ No newline at end of file diff --git a/.inductor_cache/sl/csl35uebvdbczppjgntgmnutdjrljqewnfhmnvz33m6unz7vdiu7.py b/.inductor_cache/sl/csl35uebvdbczppjgntgmnutdjrljqewnfhmnvz33m6unz7vdiu7.py new file mode 100644 index 0000000000000000000000000000000000000000..4008bcd2e4e93d0e78e7fc5e1cee93afcdffe675 --- /dev/null +++ b/.inductor_cache/sl/csl35uebvdbczppjgntgmnutdjrljqewnfhmnvz33m6unz7vdiu7.py @@ -0,0 +1,24 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8192}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*bf16', 'out_ptr0': '*bf16', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=4, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 36864}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask).to(tl.float32) + tl.store(out_ptr0 + (x0), tmp0, xmask) diff --git a/.inductor_cache/sm/csmhkmklmfo5h4gcgl6wazfjapbn6edilhx43by42rcvlwmhrmz6.py b/.inductor_cache/sm/csmhkmklmfo5h4gcgl6wazfjapbn6edilhx43by42rcvlwmhrmz6.py new file mode 100644 index 0000000000000000000000000000000000000000..acaa2fe8c12693ea7f2218bc68b445ce909d9354 --- /dev/null +++ b/.inductor_cache/sm/csmhkmklmfo5h4gcgl6wazfjapbn6edilhx43by42rcvlwmhrmz6.py @@ -0,0 +1,24 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 2}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=3, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_gather_max_view_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 12}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_gather_max_view_1(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tl.store(out_ptr0 + (x0), tmp0, xmask) diff --git a/.inductor_cache/st/cstfh4mhguv7pcjaog3rd3lx4ufqdojruikxhbs6gnn4645kfksi.py b/.inductor_cache/st/cstfh4mhguv7pcjaog3rd3lx4ufqdojruikxhbs6gnn4645kfksi.py new file mode 100644 index 0000000000000000000000000000000000000000..a6e1f2dfc93dfd5f4789665da4328dcb28963d1d --- /dev/null +++ b/.inductor_cache/st/cstfh4mhguv7pcjaog3rd3lx4ufqdojruikxhbs6gnn4645kfksi.py @@ -0,0 +1,29 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 256}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'in_ptr2': 'fp64', 'out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=0, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_unsqueeze_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 3, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 4096}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_unsqueeze_0(in_ptr0, in_ptr1, in_ptr2, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp3 = in_ptr2 + tmp2 = tmp0 * tmp1 + tmp4 = tmp3.to(tl.float32) + tmp5 = tmp2 * tmp4 + tl.store(out_ptr0 + (x0), tmp5, xmask) diff --git a/.inductor_cache/st/d5204d4c7c6c7338412164cd971000160a3123e244fefa331adae762b8e5e3c4.best_config b/.inductor_cache/st/d5204d4c7c6c7338412164cd971000160a3123e244fefa331adae762b8e5e3c4.best_config new file mode 100644 index 0000000000000000000000000000000000000000..dd6abf16e86d437b3f6c758461775fe7672e603d --- /dev/null +++ b/.inductor_cache/st/d5204d4c7c6c7338412164cd971000160a3123e244fefa331adae762b8e5e3c4.best_config @@ -0,0 +1 @@ +{"XBLOCK": 256, "num_warps": 4, "num_stages": 1, "configs_hash": "1b2cc4dbebb9680d3ce31843331593b159e4046c056f195ca1ccf2464d5b37d1", "found_by_coordesc": false, "time_taken_ms": 22, "triton_cache_hash": "5FUAZKDVQOXOEQJ4ZSRVOWBR6F6PBWI7HIJDQ3SM267VH2IXPT5A"} \ No newline at end of file diff --git a/.inductor_cache/t3/ct3zvfrlnhneovetk46gervdzkofwrmdqwocqcysjyfr3bhpgjdm.py b/.inductor_cache/t3/ct3zvfrlnhneovetk46gervdzkofwrmdqwocqcysjyfr3bhpgjdm.py new file mode 100644 index 0000000000000000000000000000000000000000..93a4649967be47985db8aa1052107bf3e4d7c036 --- /dev/null +++ b/.inductor_cache/t3/ct3zvfrlnhneovetk46gervdzkofwrmdqwocqcysjyfr3bhpgjdm.py @@ -0,0 +1,24 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'out_ptr0': '*i64', 'ks0': 'i64', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=1, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_max_view_3', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 0, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_max_view_3(out_ptr0, ks0, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = ks0 + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32)), tmp0, None) diff --git a/.inductor_cache/tb/ctb2csqqtfeyjztlp26mec7wqzkh7dhzmo4cs2pu47vfg4lfqlzd.py b/.inductor_cache/tb/ctb2csqqtfeyjztlp26mec7wqzkh7dhzmo4cs2pu47vfg4lfqlzd.py new file mode 100644 index 0000000000000000000000000000000000000000..4580617cb2dada7389aee9f0f92c2d9d1d89ec14 --- /dev/null +++ b/.inductor_cache/tb/ctb2csqqtfeyjztlp26mec7wqzkh7dhzmo4cs2pu47vfg4lfqlzd.py @@ -0,0 +1,137 @@ +# AOT ID: ['10_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/6z/c6zyuqh3bo3nxnmo267egfmzuh75yqhd4pdyfrvq5jc5nfexlxsk.py +# Topologically Sorted Source Nodes: [unsqueeze, mul], Original ATen: [aten.unsqueeze, aten.mul] +# Source node to ATen node mapping: +# mul => mul_2 +# unsqueeze => unsqueeze +# Graph fragment: +# %arg1_1 : Tensor "f32[1, s3][s3, 1]cuda:1" = PlaceHolder[target=arg1_1] +# %arg2_1 : Tensor "f32[1, s3, 1][s3, 1, 1]cuda:1" = PlaceHolder[target=arg2_1] +# %arg3_1 : Tensor "f64[][]cpu" = PlaceHolder[target=arg3_1] +# %unsqueeze : Tensor "f32[1, s3, 1][s3, 1, 1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%arg1_1, -1), kwargs = {}) +# %mul_2 : Tensor "f32[1, s3, 1][s3, 1, 1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%unsqueeze, %arg2_1), kwargs = {}) +# %convert_element_type_default_1 : Tensor "f32[][]cpu"[num_users=1] = call_function[target=torch.ops.prims.convert_element_type.default](args = (%arg3_1, torch.float32), kwargs = {}) +# %mul_tensor : Tensor "f32[1, s3, 1][s3, 1, 1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mul_2, %convert_element_type_default_1), kwargs = {}) +# return %mul_tensor +triton_poi_fused_mul_unsqueeze_0 = async_compile.triton('triton_poi_fused_mul_unsqueeze_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 32}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'in_ptr2': 'fp64', 'out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=1, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_unsqueeze_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 3, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 512}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_unsqueeze_0(in_ptr0, in_ptr1, in_ptr2, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp3 = in_ptr2 + tmp2 = tmp0 * tmp1 + tmp4 = tmp3.to(tl.float32) + tmp5 = tmp2 * tmp4 + tl.store(out_ptr0 + (x0), tmp5, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1 = args + args.clear() + s3 = arg0_1 + assert_size_stride(arg1_1, (1, s3), (s3, 1)) + assert_size_stride(arg2_1, (1, s3, 1), (s3, 1, 1)) + assert_size_stride(arg3_1, (), ()) + with torch.cuda._DeviceGuard(1): + torch.cuda.set_device(1) + buf0 = empty_strided_cuda((1, s3, 1), (s3, 1, 1), torch.float32) + # Topologically Sorted Source Nodes: [unsqueeze, mul], Original ATen: [aten.unsqueeze, aten.mul] + stream1 = get_raw_stream(1) + triton_poi_fused_mul_unsqueeze_0.run(arg1_1, arg2_1, arg3_1.item(), buf0, s3, stream=stream1) + del arg1_1 + del arg2_1 + del arg3_1 + return (buf0, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = 32 + arg1_1 = rand_strided((1, 32), (32, 1), device='cuda:1', dtype=torch.float32) + arg2_1 = rand_strided((1, 32, 1), (32, 1, 1), device='cuda:1', dtype=torch.float32) + arg3_1 = rand_strided((), (), device='cpu', dtype=torch.float64) + return [arg0_1, arg1_1, arg2_1, arg3_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/tg/ctgzof7mc3offk5zjb7z5p6lj35m6e4wtwumojufxjz6tbjxwugw.py b/.inductor_cache/tg/ctgzof7mc3offk5zjb7z5p6lj35m6e4wtwumojufxjz6tbjxwugw.py new file mode 100644 index 0000000000000000000000000000000000000000..0a9691f457f20c69a6e5f986f0b9bf66bf6b4d91 --- /dev/null +++ b/.inductor_cache/tg/ctgzof7mc3offk5zjb7z5p6lj35m6e4wtwumojufxjz6tbjxwugw.py @@ -0,0 +1,24 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 2}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=0, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_gather_max_view_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 12}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_gather_max_view_1(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tl.store(out_ptr0 + (x0), tmp0, xmask) diff --git a/.inductor_cache/th/cthw3upobsy4ytxr47lmtqw4r5udf2tu64t7h2es2fby5apa4wu4.py b/.inductor_cache/th/cthw3upobsy4ytxr47lmtqw4r5udf2tu64t7h2es2fby5apa4wu4.py new file mode 100644 index 0000000000000000000000000000000000000000..414eaf6ddeae5b942878e373f245ce746449a474 --- /dev/null +++ b/.inductor_cache/th/cthw3upobsy4ytxr47lmtqw4r5udf2tu64t7h2es2fby5apa4wu4.py @@ -0,0 +1,129 @@ +# AOT ID: ['4_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/rg/crgxj53suj2lbm2v2jhlg4x6zgxxvkmacxdzsula4efvajom2y4d.py +# Topologically Sorted Source Nodes: [weights_1], Original ATen: [aten.mul] +# Source node to ATen node mapping: +# weights_1 => mul_2 +# Graph fragment: +# %mm : Tensor "f32[s77, 32][32, 1]cuda:6" = PlaceHolder[target=mm] +# %mul_2 : Tensor "f32[s77, 32][32, 1]cuda:6"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mm, 0.1767766952966369), kwargs = {}) +# return %mul_2 +triton_poi_fused_mul_0 = async_compile.triton('triton_poi_fused_mul_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 256}, + filename=__file__, + triton_meta={'signature': {'in_out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=6, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_0', 'mutated_arg_names': ['in_out_ptr0'], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 3072}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_0(in_out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_out_ptr0 + (x0), xmask) + tmp1 = tl.full([1], 0.1767766952966369, tl.float32) + tmp2 = tmp0 * tmp1 + tl.store(in_out_ptr0 + (x0), tmp2, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1 = args + args.clear() + s77 = arg1_1 + assert_size_stride(arg0_1, (32, 6144), (6144, 1)) + assert_size_stride(arg2_1, (s77, 6144), (6144, 1)) + with torch.cuda._DeviceGuard(6): + torch.cuda.set_device(6) + buf0 = empty_strided_cuda((s77, 32), (32, 1), torch.float32) + # Topologically Sorted Source Nodes: [t, weights], Original ATen: [aten.t, aten.mm] + extern_kernels.mm_dtype(arg2_1, reinterpret_tensor(arg0_1, (6144, 32), (1, 6144), 0), out_dtype=torch.float32, out=buf0) + del arg0_1 + del arg2_1 + buf1 = buf0; del buf0 # reuse + # Topologically Sorted Source Nodes: [weights_1], Original ATen: [aten.mul] + triton_poi_fused_mul_0_xnumel = 32*s77 + stream6 = get_raw_stream(6) + triton_poi_fused_mul_0.run(buf1, triton_poi_fused_mul_0_xnumel, stream=stream6) + return (buf1, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = rand_strided((32, 6144), (6144, 1), device='cuda:6', dtype=torch.bfloat16) + arg1_1 = 8 + arg2_1 = rand_strided((8, 6144), (6144, 1), device='cuda:6', dtype=torch.bfloat16) + return [arg0_1, arg1_1, arg2_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/tk/ctkv5ncbcvcsa2sqv7fy6waloep7rvxvcgauk5pfktnei5g2ypuk.py b/.inductor_cache/tk/ctkv5ncbcvcsa2sqv7fy6waloep7rvxvcgauk5pfktnei5g2ypuk.py new file mode 100644 index 0000000000000000000000000000000000000000..25c38da843d5867fd412917ba9b663cea540d536 --- /dev/null +++ b/.inductor_cache/tk/ctkv5ncbcvcsa2sqv7fy6waloep7rvxvcgauk5pfktnei5g2ypuk.py @@ -0,0 +1,24 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8}, + filename=__file__, + triton_meta={'signature': {'out_ptr0': '*i64', 'ks0': 'i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=1, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_max_view_3', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 0, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 128}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_max_view_3(out_ptr0, ks0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = ks0 + tl.store(out_ptr0 + (x0), tmp0, xmask) diff --git a/.inductor_cache/tp/c6e2ffcf9397b13d717233f636dfeb63f5f29f0fe1d7e3ffe9acc0e362c42ada.best_config b/.inductor_cache/tp/c6e2ffcf9397b13d717233f636dfeb63f5f29f0fe1d7e3ffe9acc0e362c42ada.best_config new file mode 100644 index 0000000000000000000000000000000000000000..b303ad7b1b688d767be874d26ddbd9a5dbd239da --- /dev/null +++ b/.inductor_cache/tp/c6e2ffcf9397b13d717233f636dfeb63f5f29f0fe1d7e3ffe9acc0e362c42ada.best_config @@ -0,0 +1 @@ +{"XBLOCK": 512, "num_warps": 4, "num_stages": 1, "configs_hash": "7cced77f371acaa5aa7d90332a90e0c907727cfefb71d9cc9d997c24557fc44f", "found_by_coordesc": false, "time_taken_ms": 22, "triton_cache_hash": "POQCX5OOGE3MWNWU43THDSFYI6FVGVQDFZF6Y7WGC5WOUUREZBTA"} \ No newline at end of file diff --git a/.inductor_cache/tp/ctpdramlki7worghuqh4omu3ji5k4kbvd64yby4bnrj3is4m6q6g.py b/.inductor_cache/tp/ctpdramlki7worghuqh4omu3ji5k4kbvd64yby4bnrj3is4m6q6g.py new file mode 100644 index 0000000000000000000000000000000000000000..28e1f5e766cda4d4262a063bbb993d0f9c0238d7 --- /dev/null +++ b/.inductor_cache/tp/ctpdramlki7worghuqh4omu3ji5k4kbvd64yby4bnrj3is4m6q6g.py @@ -0,0 +1,24 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 65536}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*bf16', 'out_ptr0': '*bf16', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=6, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 294912}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x2 = xindex + tmp0 = tl.load(in_ptr0 + (x2), xmask, eviction_policy='evict_last').to(tl.float32) + tl.store(out_ptr0 + (x2), tmp0, xmask) diff --git a/.inductor_cache/tt/cttxr42fjmy2jwjhl2flt3ly4uqmeqyvmarx2tyvmws24lztqlkd.py b/.inductor_cache/tt/cttxr42fjmy2jwjhl2flt3ly4uqmeqyvmarx2tyvmws24lztqlkd.py new file mode 100644 index 0000000000000000000000000000000000000000..206b73293a387c9a1e150488f5cdc5dbd78d8ffc --- /dev/null +++ b/.inductor_cache/tt/cttxr42fjmy2jwjhl2flt3ly4uqmeqyvmarx2tyvmws24lztqlkd.py @@ -0,0 +1,148 @@ +# AOT ID: ['1_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/6p/c6ppnyt6kjnrqeeq3ra4wx4kwkpeerqiq5ftck3hdmvntgpd6wcs.py +# Topologically Sorted Source Nodes: [weights_1, unsqueeze, mul_1], Original ATen: [aten.mul, aten.unsqueeze] +# Source node to ATen node mapping: +# mul_1 => mul_7 +# unsqueeze => unsqueeze +# weights_1 => mul_2 +# Graph fragment: +# %mm : Tensor "f32[s77, 32][32, 1]cuda:5" = PlaceHolder[target=mm] +# %arg3_1 : Tensor "f32[s77, 32, 1][32, 1, 1]cuda:5" = PlaceHolder[target=arg3_1] +# %arg4_1 : Tensor "f64[][]cpu" = PlaceHolder[target=arg4_1] +# %mul_2 : Tensor "f32[s77, 32][32, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mm, 0.1767766952966369), kwargs = {}) +# %unsqueeze : Tensor "f32[s77, 32, 1][32, 1, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%mul_2, -1), kwargs = {}) +# %mul_7 : Tensor "f32[s77, 32, 1][32, 1, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%unsqueeze, %arg3_1), kwargs = {}) +# %convert_element_type_default_1 : Tensor "f32[][]cpu"[num_users=1] = call_function[target=torch.ops.prims.convert_element_type.default](args = (%arg4_1, torch.float32), kwargs = {}) +# %mul_tensor : Tensor "f32[s77, 32, 1][32, 1, 1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mul_7, %convert_element_type_default_1), kwargs = {}) +# return %mul_tensor +triton_poi_fused_mul_unsqueeze_0 = async_compile.triton('triton_poi_fused_mul_unsqueeze_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 4096}, + filename=__file__, + triton_meta={'signature': {'in_out_ptr0': '*fp32', 'in_ptr0': '*fp32', 'in_ptr1': 'fp64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=5, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_unsqueeze_0', 'mutated_arg_names': ['in_out_ptr0'], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 3, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 57344}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_unsqueeze_0(in_out_ptr0, in_ptr0, in_ptr1, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_out_ptr0 + (x0), xmask) + tmp3 = tl.load(in_ptr0 + (x0), xmask) + tmp5 = in_ptr1 + tmp1 = tl.full([1], 0.1767766952966369, tl.float32) + tmp2 = tmp0 * tmp1 + tmp4 = tmp2 * tmp3 + tmp6 = tmp5.to(tl.float32) + tmp7 = tmp4 * tmp6 + tl.store(in_out_ptr0 + (x0), tmp7, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1 = args + args.clear() + s77 = arg1_1 + assert_size_stride(arg0_1, (32, 6144), (6144, 1)) + assert_size_stride(arg2_1, (s77, 6144), (6144, 1)) + assert_size_stride(arg3_1, (s77, 32, 1), (32, 1, 1)) + assert_size_stride(arg4_1, (), ()) + with torch.cuda._DeviceGuard(5): + torch.cuda.set_device(5) + buf0 = empty_strided_cuda((s77, 32), (32, 1), torch.float32) + # Topologically Sorted Source Nodes: [t, weights], Original ATen: [aten.t, aten.mm] + extern_kernels.mm_dtype(arg2_1, reinterpret_tensor(arg0_1, (6144, 32), (1, 6144), 0), out_dtype=torch.float32, out=buf0) + del arg0_1 + del arg2_1 + buf1 = reinterpret_tensor(buf0, (s77, 32, 1), (32, 1, 1), 0); del buf0 # reuse + # Topologically Sorted Source Nodes: [weights_1, unsqueeze, mul_1], Original ATen: [aten.mul, aten.unsqueeze] + triton_poi_fused_mul_unsqueeze_0_xnumel = 32*s77 + stream5 = get_raw_stream(5) + triton_poi_fused_mul_unsqueeze_0.run(buf1, arg3_1, arg4_1.item(), triton_poi_fused_mul_unsqueeze_0_xnumel, stream=stream5) + del arg3_1 + del arg4_1 + return (buf1, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = rand_strided((32, 6144), (6144, 1), device='cuda:5', dtype=torch.bfloat16) + arg1_1 = 112 + arg2_1 = rand_strided((112, 6144), (6144, 1), device='cuda:5', dtype=torch.bfloat16) + arg3_1 = rand_strided((112, 32, 1), (32, 1, 1), device='cuda:5', dtype=torch.float32) + arg4_1 = rand_strided((), (), device='cpu', dtype=torch.float64) + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/tx/ctx3ow4rzop4s3fo4njm42lqtjpbxcshr4rccyzdst3z5tpri4xp.py b/.inductor_cache/tx/ctx3ow4rzop4s3fo4njm42lqtjpbxcshr4rccyzdst3z5tpri4xp.py new file mode 100644 index 0000000000000000000000000000000000000000..052d98ee28de8c64247b625f85b20c9c301918ea --- /dev/null +++ b/.inductor_cache/tx/ctx3ow4rzop4s3fo4njm42lqtjpbxcshr4rccyzdst3z5tpri4xp.py @@ -0,0 +1,37 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i1', 'ks0': 'i64', 'ks1': 'i64', 'ks2': 'i64', 'ks3': 'i64', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=3, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_bitwise_and_bitwise_not_bitwise_or_ge_lt_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_bitwise_and_bitwise_not_bitwise_or_ge_lt_1(in_ptr0, out_ptr0, ks0, ks1, ks2, ks3, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = tl.load(in_ptr0 + (0)) + tmp1 = tl.broadcast_to(tmp0, [XBLOCK]) + tmp2 = ks0 + tmp3 = tmp1 >= tmp2 + tmp4 = ks1 + tmp5 = tmp1 < tmp4 + tmp6 = tmp3 & tmp5 + tmp7 = ks2 + tmp8 = tmp1 >= tmp7 + tmp9 = ks3 + tmp10 = tmp1 < tmp9 + tmp11 = tmp8 & tmp10 + tmp12 = tmp6 | tmp11 + tmp13 = tmp12 == 0 + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp13, None) diff --git a/.inductor_cache/ub/cubjov6zdddejw7erne5yetgt6jmvtqncj3paqrt7uq64frw67ru.py b/.inductor_cache/ub/cubjov6zdddejw7erne5yetgt6jmvtqncj3paqrt7uq64frw67ru.py new file mode 100644 index 0000000000000000000000000000000000000000..90eff1120d38d58b1f5f70f788249aa1af494836 --- /dev/null +++ b/.inductor_cache/ub/cubjov6zdddejw7erne5yetgt6jmvtqncj3paqrt7uq64frw67ru.py @@ -0,0 +1,289 @@ +# AOT ID: ['6_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/hj/chjplywvjqptohuj7scdxpy7eoho6x43um4wo56z7eleusgeo6kv.py +# Topologically Sorted Source Nodes: [unsqueeze, view, expand_scores, flatten, max_1], Original ATen: [aten.unsqueeze, aten.view, aten.mul, aten.max] +# Source node to ATen node mapping: +# expand_scores => mul_3 +# flatten => view_1 +# max_1 => getitem, max_1 +# unsqueeze => unsqueeze +# view => view +# Graph fragment: +# %arg2_1 : Tensor "f32[s97, 1][1, 1]cuda:4" = PlaceHolder[target=arg2_1] +# %arg3_1 : Tensor "f32[s97, 1][1, 1]cuda:4" = PlaceHolder[target=arg3_1] +# %mul_3 : Tensor "f32[s97, 1, 1][1, 1, 1]cuda:4" = PlaceHolder[target=mul_3] +# %unsqueeze : Tensor "f32[s97, 1, 1][1, 1, 1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%arg2_1, 2), kwargs = {}) +# %view : Tensor "f32[s97, 1, 1][1, 1, 1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%arg3_1, [-1, 1, 1]), kwargs = {}) +# %mul_3 : Tensor "f32[s97, 1, 1][1, 1, 1]cuda:4"[num_users=2] = call_function[target=torch.ops.aten.mul.Tensor](args = (%unsqueeze, %view), kwargs = {}) +# %view_1 : Tensor "f32[s97, 1][1, 1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg1_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %getitem : Tensor "f32[s97, 1][1, 1]cuda:4"[num_users=1] = call_function[target=operator.getitem](args = (%max_1, 0), kwargs = {}) +# return %mul_3,%getitem +triton_poi_fused_max_mul_unsqueeze_view_0 = async_compile.triton('triton_poi_fused_max_mul_unsqueeze_view_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'out_ptr0': '*fp32', 'out_ptr1': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=4, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_max_mul_unsqueeze_view_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 2, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 192}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_max_mul_unsqueeze_view_0(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp2 = tmp0 * tmp1 + tl.store(out_ptr0 + (x0), tmp2, xmask) + tl.store(out_ptr1 + (x0), tmp2, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/pn/cpner6uolczn44zhjl2hwjnpnblo3rw6gguet6a5o5ueqes2cfo7.py +# Topologically Sorted Source Nodes: [flatten, max_1, gather], Original ATen: [aten.view, aten.max, aten.gather] +# Source node to ATen node mapping: +# flatten => view_1 +# gather => gather +# max_1 => max_1 +# Graph fragment: +# %arg4_1 : Tensor "i64[s97, 1][1, 1]cuda:4" = PlaceHolder[target=arg4_1] +# %view_1 : Tensor "f32[s97, 1][1, 1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg1_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %gather : Tensor "i64[s97, 1][1, 1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.gather.default](args = (%arg4_1, 1, %getitem_1), kwargs = {}) +# return %gather +triton_poi_fused_gather_max_view_1 = async_compile.triton('triton_poi_fused_gather_max_view_1', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=4, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_gather_max_view_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 192}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_gather_max_view_1(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tl.store(out_ptr0 + (x0), tmp0, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/ls/clsiben2w5lcnbhgxdfctbonf7bwxklyzvowh7rxhjlmnmsj365j.py +# Topologically Sorted Source Nodes: [flatten, max_1, flat_cs, floordiv, batch_offsets, repeat_interleave, selected_input_index, hidden_states], Original ATen: [aten.view, aten.max, aten.floor_divide, aten.arange, aten.unsqueeze, aten.add, aten.index] +# Source node to ATen node mapping: +# batch_offsets => iota +# flat_cs => view_4 +# flatten => view_1 +# floordiv => div +# hidden_states => index +# max_1 => max_1 +# repeat_interleave => unsqueeze_1, view_5 +# selected_input_index => add_47 +# Graph fragment: +# %arg6_1 : Tensor "bf16[s97, s87][s87, 1]cuda:4" = PlaceHolder[target=arg6_1] +# %view_1 : Tensor "f32[s97, 1][1, 1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg1_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %view_4 : Tensor "i64[s97][1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%getitem_1, [%arg1_1]), kwargs = {}) +# %div : Tensor "i64[s97][1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.div.Tensor_mode](args = (%view_4, 1), kwargs = {rounding_mode: floor}) +# %iota : Tensor "i64[s97][1]cuda:4"[num_users=1] = call_function[target=torch.ops.prims.iota.default](args = (%arg1_1,), kwargs = {start: 0, step: 1, dtype: torch.int64, device: cuda:4, requires_grad: False}) +# %unsqueeze_1 : Tensor "i64[s97, 1][1, 1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%iota, 1), kwargs = {}) +# %view_5 : Tensor "i64[s97][1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%expand, [%arg1_1]), kwargs = {}) +# %add_47 : Tensor "i64[s97][1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%div, %view_5), kwargs = {}) +# %index : Tensor "bf16[s97, s87][s87, 1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.index.Tensor](args = (%arg6_1, [%add_47]), kwargs = {}) +# return %index +triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2 = async_compile.triton('triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 65536}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*bf16', 'out_ptr0': '*bf16', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=4, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 294912}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x2 = xindex + tmp0 = tl.load(in_ptr0 + (x2), xmask, eviction_policy='evict_last').to(tl.float32) + tl.store(out_ptr0 + (x2), tmp0, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/rl/crltwbaishol4iopibb6vgr7hpf646hjigovxhdihykrppm3ix4g.py +# Topologically Sorted Source Nodes: [flatten, max_1, add_2], Original ATen: [aten.view, aten.max, aten.add] +# Source node to ATen node mapping: +# add_2 => add_53 +# flatten => view_1 +# max_1 => max_1 +# Graph fragment: +# %view_1 : Tensor "f32[s97, 1][1, 1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg1_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %add_53 : Tensor "i64[s97, 1][1, 1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%getitem_1, %arg7_1), kwargs = {}) +# return %add_53 +triton_poi_fused_add_max_view_3 = async_compile.triton('triton_poi_fused_add_max_view_3', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8}, + filename=__file__, + triton_meta={'signature': {'out_ptr0': '*i64', 'ks0': 'i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=4, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_max_view_3', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 0, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 128}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_max_view_3(out_ptr0, ks0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = ks0 + tl.store(out_ptr0 + (x0), tmp0, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1, arg7_1 = args + args.clear() + s53 = arg0_1 + s97 = arg1_1 + s87 = arg5_1 + s77 = arg7_1 + assert_size_stride(arg2_1, (s97, 1), (1, 1)) + assert_size_stride(arg3_1, (s97, 1), (1, 1)) + assert_size_stride(arg4_1, (s97, 1), (1, 1)) + assert_size_stride(arg6_1, (s97, s87), (s87, 1)) + with torch.cuda._DeviceGuard(4): + torch.cuda.set_device(4) + buf0 = empty_strided_cuda((s97, 1, 1), (1, 1, 1), torch.float32) + buf1 = empty_strided_cuda((s97, 1), (1, 1), torch.float32) + # Topologically Sorted Source Nodes: [unsqueeze, view, expand_scores, flatten, max_1], Original ATen: [aten.unsqueeze, aten.view, aten.mul, aten.max] + stream4 = get_raw_stream(4) + triton_poi_fused_max_mul_unsqueeze_view_0.run(arg2_1, arg3_1, buf0, buf1, s97, stream=stream4) + del arg2_1 + del arg3_1 + buf2 = empty_strided_cuda((s97, 1), (1, 1), torch.int64) + # Topologically Sorted Source Nodes: [flatten, max_1, gather], Original ATen: [aten.view, aten.max, aten.gather] + stream4 = get_raw_stream(4) + triton_poi_fused_gather_max_view_1.run(arg4_1, buf2, s97, stream=stream4) + buf3 = empty_strided_cuda((s97, s87), (s87, 1), torch.bfloat16) + # Topologically Sorted Source Nodes: [flatten, max_1, flat_cs, floordiv, batch_offsets, repeat_interleave, selected_input_index, hidden_states], Original ATen: [aten.view, aten.max, aten.floor_divide, aten.arange, aten.unsqueeze, aten.add, aten.index] + triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2_xnumel = s87*s97 + stream4 = get_raw_stream(4) + triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2.run(arg6_1, buf3, triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2_xnumel, stream=stream4) + del arg6_1 + buf4 = empty_strided_cuda((s97, 1), (1, 1), torch.int64) + # Topologically Sorted Source Nodes: [flatten, max_1, add_2], Original ATen: [aten.view, aten.max, aten.add] + stream4 = get_raw_stream(4) + triton_poi_fused_add_max_view_3.run(buf4, s77, s97, stream=stream4) + return (reinterpret_tensor(buf2, (s97, ), (1, ), 0), buf3, buf1, buf0, arg4_1, buf4, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = 1 + arg1_1 = 8 + arg2_1 = rand_strided((8, 1), (1, 1), device='cuda:4', dtype=torch.float32) + arg3_1 = rand_strided((8, 1), (1, 1), device='cuda:4', dtype=torch.float32) + arg4_1 = rand_strided((8, 1), (1, 1), device='cuda:4', dtype=torch.int64) + arg5_1 = 6144 + arg6_1 = rand_strided((8, 6144), (6144, 1), device='cuda:4', dtype=torch.bfloat16) + arg7_1 = 1 + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1, arg7_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/ub/cubrga4p6slgmvpkerkbtbebckik3kdln7y7xyo466mbcclx3vly.py b/.inductor_cache/ub/cubrga4p6slgmvpkerkbtbebckik3kdln7y7xyo466mbcclx3vly.py new file mode 100644 index 0000000000000000000000000000000000000000..5246e3566efe3bb6f12605ef3310af6b17fcdcb7 --- /dev/null +++ b/.inductor_cache/ub/cubrga4p6slgmvpkerkbtbebckik3kdln7y7xyo466mbcclx3vly.py @@ -0,0 +1,24 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 2}, + filename=__file__, + triton_meta={'signature': {'out_ptr0': '*i64', 'ks0': 'i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=3, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_max_view_3', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 0, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 8}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_max_view_3(out_ptr0, ks0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = ks0 + tl.store(out_ptr0 + (x0), tmp0, xmask) diff --git a/.inductor_cache/ub/cubsjgg342ys5uwytx3rl63nk6sq3y6n25kbexro4pvagnal3rcr.py b/.inductor_cache/ub/cubsjgg342ys5uwytx3rl63nk6sq3y6n25kbexro4pvagnal3rcr.py new file mode 100644 index 0000000000000000000000000000000000000000..ccf5ed0ee33ab3c12967c257961f232b85ddd76d --- /dev/null +++ b/.inductor_cache/ub/cubsjgg342ys5uwytx3rl63nk6sq3y6n25kbexro4pvagnal3rcr.py @@ -0,0 +1,129 @@ +# AOT ID: ['4_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/4w/c4wbe3nz76vrohi4tguyhvtuuwxq5ot6a6vjcubrww3al5ynrkzg.py +# Topologically Sorted Source Nodes: [weights_1], Original ATen: [aten.mul] +# Source node to ATen node mapping: +# weights_1 => mul_2 +# Graph fragment: +# %mm : Tensor "f32[s77, 32][32, 1]cuda:7" = PlaceHolder[target=mm] +# %mul_2 : Tensor "f32[s77, 32][32, 1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mm, 0.1767766952966369), kwargs = {}) +# return %mul_2 +triton_poi_fused_mul_0 = async_compile.triton('triton_poi_fused_mul_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 256}, + filename=__file__, + triton_meta={'signature': {'in_out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=7, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_0', 'mutated_arg_names': ['in_out_ptr0'], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 3072}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_0(in_out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_out_ptr0 + (x0), xmask) + tmp1 = tl.full([1], 0.1767766952966369, tl.float32) + tmp2 = tmp0 * tmp1 + tl.store(in_out_ptr0 + (x0), tmp2, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1 = args + args.clear() + s77 = arg1_1 + assert_size_stride(arg0_1, (32, 6144), (6144, 1)) + assert_size_stride(arg2_1, (s77, 6144), (6144, 1)) + with torch.cuda._DeviceGuard(7): + torch.cuda.set_device(7) + buf0 = empty_strided_cuda((s77, 32), (32, 1), torch.float32) + # Topologically Sorted Source Nodes: [t, weights], Original ATen: [aten.t, aten.mm] + extern_kernels.mm_dtype(arg2_1, reinterpret_tensor(arg0_1, (6144, 32), (1, 6144), 0), out_dtype=torch.float32, out=buf0) + del arg0_1 + del arg2_1 + buf1 = buf0; del buf0 # reuse + # Topologically Sorted Source Nodes: [weights_1], Original ATen: [aten.mul] + triton_poi_fused_mul_0_xnumel = 32*s77 + stream7 = get_raw_stream(7) + triton_poi_fused_mul_0.run(buf1, triton_poi_fused_mul_0_xnumel, stream=stream7) + return (buf1, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = rand_strided((32, 6144), (6144, 1), device='cuda:7', dtype=torch.bfloat16) + arg1_1 = 8 + arg2_1 = rand_strided((8, 6144), (6144, 1), device='cuda:7', dtype=torch.bfloat16) + return [arg0_1, arg1_1, arg2_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/uc/2c5fcafe451cec3bd6f26008e152ec80ab0f2c135275c6d8e3029f73d3424219.best_config b/.inductor_cache/uc/2c5fcafe451cec3bd6f26008e152ec80ab0f2c135275c6d8e3029f73d3424219.best_config new file mode 100644 index 0000000000000000000000000000000000000000..e558339c4f98efe880663e0d38a40a0b26663664 --- /dev/null +++ b/.inductor_cache/uc/2c5fcafe451cec3bd6f26008e152ec80ab0f2c135275c6d8e3029f73d3424219.best_config @@ -0,0 +1 @@ +{"XBLOCK": 256, "num_warps": 4, "num_stages": 1, "configs_hash": "1b2cc4dbebb9680d3ce31843331593b159e4046c056f195ca1ccf2464d5b37d1", "found_by_coordesc": false, "time_taken_ms": 44, "triton_cache_hash": "KGGY5WAIFCN23ENKRQFNT2OZB6CJLZGZIIMD5KHX6XAEJ3DEY7VA"} \ No newline at end of file diff --git a/.inductor_cache/uc/cucmd33h5amxj6vf3wswqdgekb6bccqg7iuesszrizh56sgt5fnr.py b/.inductor_cache/uc/cucmd33h5amxj6vf3wswqdgekb6bccqg7iuesszrizh56sgt5fnr.py new file mode 100644 index 0000000000000000000000000000000000000000..17f4ae7b93a553440dd51dcdba35ff5d0bcb0267 --- /dev/null +++ b/.inductor_cache/uc/cucmd33h5amxj6vf3wswqdgekb6bccqg7iuesszrizh56sgt5fnr.py @@ -0,0 +1,31 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 4096}, + filename=__file__, + triton_meta={'signature': {'in_out_ptr0': '*fp32', 'in_ptr0': '*fp32', 'in_ptr1': 'fp64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=4, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_unsqueeze_0', 'mutated_arg_names': ['in_out_ptr0'], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 3, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 57344}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_unsqueeze_0(in_out_ptr0, in_ptr0, in_ptr1, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_out_ptr0 + (x0), xmask) + tmp3 = tl.load(in_ptr0 + (x0), xmask) + tmp5 = in_ptr1 + tmp1 = tl.full([1], 0.1767766952966369, tl.float32) + tmp2 = tmp0 * tmp1 + tmp4 = tmp2 * tmp3 + tmp6 = tmp5.to(tl.float32) + tmp7 = tmp4 * tmp6 + tl.store(in_out_ptr0 + (x0), tmp7, xmask) diff --git a/.inductor_cache/un/cun3h5xetskkgqj652kojes6opfqbaexbkzn5bq2lhsitna2pl4x.py b/.inductor_cache/un/cun3h5xetskkgqj652kojes6opfqbaexbkzn5bq2lhsitna2pl4x.py new file mode 100644 index 0000000000000000000000000000000000000000..0a9f1017c21101cdd73fc1000ac0da405d90c71b --- /dev/null +++ b/.inductor_cache/un/cun3h5xetskkgqj652kojes6opfqbaexbkzn5bq2lhsitna2pl4x.py @@ -0,0 +1,24 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=1, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_gather_max_view_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 192}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_gather_max_view_1(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tl.store(out_ptr0 + (x0), tmp0, xmask) diff --git a/.inductor_cache/up/cup3pmotpqrohzxz6sehtheaddv4i6ce6gd65uywqgf3bc7rc4ll.py b/.inductor_cache/up/cup3pmotpqrohzxz6sehtheaddv4i6ce6gd65uywqgf3bc7rc4ll.py new file mode 100644 index 0000000000000000000000000000000000000000..906c9c8f3021e639861f86b4c9b676e805da54d7 --- /dev/null +++ b/.inductor_cache/up/cup3pmotpqrohzxz6sehtheaddv4i6ce6gd65uywqgf3bc7rc4ll.py @@ -0,0 +1,291 @@ +# AOT ID: ['7_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/eu/ceujptddvohmrpmi3d35cfzrtagwszsxwklnkpos5z5fi3vn46sj.py +# Topologically Sorted Source Nodes: [unsqueeze, view, expand_scores, flatten, max_1], Original ATen: [aten.unsqueeze, aten.view, aten.mul, aten.max] +# Source node to ATen node mapping: +# expand_scores => mul_3 +# flatten => view_1 +# max_1 => getitem, max_1 +# unsqueeze => unsqueeze +# view => view +# Graph fragment: +# %arg2_1 : Tensor "f32[s0, 1][1, 1]cuda:3" = PlaceHolder[target=arg2_1] +# %arg4_1 : Tensor "f32[s0, 1][1, 1]cuda:3" = PlaceHolder[target=arg4_1] +# %mul_3 : Tensor "f32[s0, 1, 1][1, 1, 1]cuda:3" = PlaceHolder[target=mul_3] +# %unsqueeze : Tensor "f32[s0, 1, 1][1, 1, 1]cuda:3"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%arg2_1, 2), kwargs = {}) +# %view : Tensor "f32[s0, 1, 1][1, 1, 1]cuda:3"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%arg4_1, [-1, 1, 1]), kwargs = {}) +# %mul_3 : Tensor "f32[s0, 1, 1][1, 1, 1]cuda:3"[num_users=2] = call_function[target=torch.ops.aten.mul.Tensor](args = (%unsqueeze, %view), kwargs = {}) +# %view_1 : Tensor "f32[s0, 1][1, 1]cuda:3"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg3_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %getitem : Tensor "f32[s0, 1][1, 1]cuda:3"[num_users=1] = call_function[target=operator.getitem](args = (%max_1, 0), kwargs = {}) +# return %mul_3,%getitem +triton_poi_fused_max_mul_unsqueeze_view_0 = async_compile.triton('triton_poi_fused_max_mul_unsqueeze_view_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'out_ptr0': '*fp32', 'out_ptr1': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=3, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_max_mul_unsqueeze_view_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 2, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 192}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_max_mul_unsqueeze_view_0(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp2 = tmp0 * tmp1 + tl.store(out_ptr0 + (x0), tmp2, xmask) + tl.store(out_ptr1 + (x0), tmp2, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/jw/cjwnm4nhtti6dx4kp7rcgvjpxw7ab72wy3zgvwtnnqtlbtlmkzlu.py +# Topologically Sorted Source Nodes: [flatten, max_1, gather], Original ATen: [aten.view, aten.max, aten.gather] +# Source node to ATen node mapping: +# flatten => view_1 +# gather => gather +# max_1 => max_1 +# Graph fragment: +# %arg5_1 : Tensor "i64[s0, 1][1, 1]cuda:3" = PlaceHolder[target=arg5_1] +# %view_1 : Tensor "f32[s0, 1][1, 1]cuda:3"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg3_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %gather : Tensor "i64[s0, 1][1, 1]cuda:3"[num_users=1] = call_function[target=torch.ops.aten.gather.default](args = (%arg5_1, 1, %getitem_1), kwargs = {}) +# return %gather +triton_poi_fused_gather_max_view_1 = async_compile.triton('triton_poi_fused_gather_max_view_1', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=3, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_gather_max_view_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 192}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_gather_max_view_1(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tl.store(out_ptr0 + (x0), tmp0, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/o6/co6hyomcl3npwceolu64q5bdvrb7h6qa4h3fycnlkntxzzmdzmue.py +# Topologically Sorted Source Nodes: [flatten, max_1, flat_cs, floordiv, batch_offsets, repeat_interleave, selected_input_index, hidden_states], Original ATen: [aten.view, aten.max, aten.floor_divide, aten.arange, aten.unsqueeze, aten.add, aten.index] +# Source node to ATen node mapping: +# batch_offsets => iota +# flat_cs => view_4 +# flatten => view_1 +# floordiv => div +# hidden_states => index +# max_1 => max_1 +# repeat_interleave => unsqueeze_1, view_5 +# selected_input_index => add_47 +# Graph fragment: +# %arg7_1 : Tensor "bf16[s0, s87][s87, 1]cuda:3" = PlaceHolder[target=arg7_1] +# %view_1 : Tensor "f32[s0, 1][1, 1]cuda:3"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg3_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %view_4 : Tensor "i64[s0][1]cuda:3"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%getitem_1, [%arg3_1]), kwargs = {}) +# %div : Tensor "i64[s0][1]cuda:3"[num_users=1] = call_function[target=torch.ops.aten.div.Tensor_mode](args = (%view_4, 1), kwargs = {rounding_mode: floor}) +# %iota : Tensor "i64[s0][1]cuda:3"[num_users=1] = call_function[target=torch.ops.prims.iota.default](args = (%arg3_1,), kwargs = {start: 0, step: 1, dtype: torch.int64, device: cuda:3, requires_grad: False}) +# %unsqueeze_1 : Tensor "i64[s0, 1][1, 1]cuda:3"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%iota, 1), kwargs = {}) +# %view_5 : Tensor "i64[s0][1]cuda:3"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%expand, [%arg3_1]), kwargs = {}) +# %add_47 : Tensor "i64[s0][1]cuda:3"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%div, %view_5), kwargs = {}) +# %index : Tensor "bf16[s0, s87][s87, 1]cuda:3"[num_users=1] = call_function[target=torch.ops.aten.index.Tensor](args = (%arg7_1, [%add_47]), kwargs = {}) +# return %index +triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2 = async_compile.triton('triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 65536}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*bf16', 'out_ptr0': '*bf16', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=3, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 294912}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x2 = xindex + tmp0 = tl.load(in_ptr0 + (x2), xmask, eviction_policy='evict_last').to(tl.float32) + tl.store(out_ptr0 + (x2), tmp0, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/dm/cdmvkduxzdqrvvphvyrynpwm77ulv5m44qrmm2izq36cx2yge35l.py +# Topologically Sorted Source Nodes: [flatten, max_1, add_2], Original ATen: [aten.view, aten.max, aten.add] +# Source node to ATen node mapping: +# add_2 => add_53 +# flatten => view_1 +# max_1 => max_1 +# Graph fragment: +# %view_1 : Tensor "f32[s0, 1][1, 1]cuda:3"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_3, [%arg3_1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %add_53 : Tensor "i64[s0, 1][1, 1]cuda:3"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%getitem_1, %arg8_1), kwargs = {}) +# return %add_53 +triton_poi_fused_add_max_view_3 = async_compile.triton('triton_poi_fused_add_max_view_3', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8}, + filename=__file__, + triton_meta={'signature': {'out_ptr0': '*i64', 'ks0': 'i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=3, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_max_view_3', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 0, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 128}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_max_view_3(out_ptr0, ks0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = ks0 + tl.store(out_ptr0 + (x0), tmp0, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1, arg7_1, arg8_1 = args + args.clear() + s53 = arg0_1 + s68 = arg1_1 + s0 = arg3_1 + s87 = arg6_1 + s77 = arg8_1 + assert_size_stride(arg2_1, (s0, 1), (1, 1)) + assert_size_stride(arg4_1, (s0, 1), (1, 1)) + assert_size_stride(arg5_1, (s0, 1), (1, 1)) + assert_size_stride(arg7_1, (s0, s87), (s87, 1)) + with torch.cuda._DeviceGuard(3): + torch.cuda.set_device(3) + buf0 = empty_strided_cuda((s0, 1, 1), (1, 1, 1), torch.float32) + buf1 = empty_strided_cuda((s0, 1), (1, 1), torch.float32) + # Topologically Sorted Source Nodes: [unsqueeze, view, expand_scores, flatten, max_1], Original ATen: [aten.unsqueeze, aten.view, aten.mul, aten.max] + stream3 = get_raw_stream(3) + triton_poi_fused_max_mul_unsqueeze_view_0.run(arg2_1, arg4_1, buf0, buf1, s0, stream=stream3) + del arg2_1 + del arg4_1 + buf2 = empty_strided_cuda((s0, 1), (1, 1), torch.int64) + # Topologically Sorted Source Nodes: [flatten, max_1, gather], Original ATen: [aten.view, aten.max, aten.gather] + stream3 = get_raw_stream(3) + triton_poi_fused_gather_max_view_1.run(arg5_1, buf2, s0, stream=stream3) + buf3 = empty_strided_cuda((s0, s87), (s87, 1), torch.bfloat16) + # Topologically Sorted Source Nodes: [flatten, max_1, flat_cs, floordiv, batch_offsets, repeat_interleave, selected_input_index, hidden_states], Original ATen: [aten.view, aten.max, aten.floor_divide, aten.arange, aten.unsqueeze, aten.add, aten.index] + triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2_xnumel = s0*s87 + stream3 = get_raw_stream(3) + triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2.run(arg7_1, buf3, triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2_xnumel, stream=stream3) + del arg7_1 + buf4 = empty_strided_cuda((s0, 1), (1, 1), torch.int64) + # Topologically Sorted Source Nodes: [flatten, max_1, add_2], Original ATen: [aten.view, aten.max, aten.add] + stream3 = get_raw_stream(3) + triton_poi_fused_add_max_view_3.run(buf4, s77, s0, stream=stream3) + return (reinterpret_tensor(buf2, (s0, ), (1, ), 0), buf3, buf1, buf0, arg5_1, buf4, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = 1 + arg1_1 = 8 + arg2_1 = rand_strided((8, 1), (1, 1), device='cuda:3', dtype=torch.float32) + arg3_1 = 8 + arg4_1 = rand_strided((8, 1), (1, 1), device='cuda:3', dtype=torch.float32) + arg5_1 = rand_strided((8, 1), (1, 1), device='cuda:3', dtype=torch.int64) + arg6_1 = 6144 + arg7_1 = rand_strided((8, 6144), (6144, 1), device='cuda:3', dtype=torch.bfloat16) + arg8_1 = 2 + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1, arg7_1, arg8_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/v3/cv3ijsfbyazwfq2i7po6shiol3ocm624xnr5bnre5h6g6fxuo6vj.py b/.inductor_cache/v3/cv3ijsfbyazwfq2i7po6shiol3ocm624xnr5bnre5h6g6fxuo6vj.py new file mode 100644 index 0000000000000000000000000000000000000000..d321d270d54d202c8e276f0a4132a4fb3d97bede --- /dev/null +++ b/.inductor_cache/v3/cv3ijsfbyazwfq2i7po6shiol3ocm624xnr5bnre5h6g6fxuo6vj.py @@ -0,0 +1,177 @@ +# AOT ID: ['0_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/a6/ca6uwbc2bkn5w6nhfj4fu4wddj5vy3xck3kd6szlhbpxghjeqwwz.py +# Topologically Sorted Source Nodes: [ge, lt, org_vocab_mask, ge_1, lt_1, added_vocab_mask, vocab_mask, mul, mul_1, valid_offset, sub_3, input_, invert], Original ATen: [aten.ge, aten.lt, aten.bitwise_and, aten.bitwise_or, aten.mul, aten.add, aten.sub, aten.bitwise_not] +# Source node to ATen node mapping: +# added_vocab_mask => bitwise_and_1 +# ge => ge +# ge_1 => ge_1 +# input_ => mul_6 +# invert => bitwise_not +# lt => lt +# lt_1 => lt_1 +# mul => mul +# mul_1 => mul_2 +# org_vocab_mask => bitwise_and +# sub_3 => sub_13 +# valid_offset => add_16 +# vocab_mask => bitwise_or +# Graph fragment: +# %arg1_1 : Tensor "i64[s15][1]cuda:1" = PlaceHolder[target=arg1_1] +# %ge : Tensor "b8[s15][1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.ge.Scalar](args = (%arg1_1, %arg2_1), kwargs = {}) +# %lt : Tensor "b8[s15][1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.lt.Scalar](args = (%arg1_1, %arg3_1), kwargs = {}) +# %bitwise_and : Tensor "b8[s15][1]cuda:1"[num_users=2] = call_function[target=torch.ops.aten.bitwise_and.Tensor](args = (%ge, %lt), kwargs = {}) +# %ge_1 : Tensor "b8[s15][1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.ge.Scalar](args = (%arg1_1, %arg4_1), kwargs = {}) +# %lt_1 : Tensor "b8[s15][1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.lt.Scalar](args = (%arg1_1, %arg5_1), kwargs = {}) +# %bitwise_and_1 : Tensor "b8[s15][1]cuda:1"[num_users=2] = call_function[target=torch.ops.aten.bitwise_and.Tensor](args = (%ge_1, %lt_1), kwargs = {}) +# %bitwise_or : Tensor "b8[s15][1]cuda:1"[num_users=2] = call_function[target=torch.ops.aten.bitwise_or.Tensor](args = (%bitwise_and, %bitwise_and_1), kwargs = {}) +# %mul : Tensor "i64[s15][1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%bitwise_and, %arg2_1), kwargs = {}) +# %mul_2 : Tensor "i64[s15][1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%bitwise_and_1, %sub_8), kwargs = {}) +# %add_16 : Tensor "i64[s15][1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%mul, %mul_2), kwargs = {}) +# %sub_13 : Tensor "i64[s15][1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%arg1_1, %add_16), kwargs = {}) +# %mul_6 : Tensor "i64[s15][1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%bitwise_or, %sub_13), kwargs = {}) +# %bitwise_not : Tensor "b8[s15][1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.bitwise_not.default](args = (%bitwise_or,), kwargs = {}) +# return %mul_6,%bitwise_not +triton_poi_fused_add_bitwise_and_bitwise_not_bitwise_or_ge_lt_mul_sub_0 = async_compile.triton('triton_poi_fused_add_bitwise_and_bitwise_not_bitwise_or_ge_lt_mul_sub_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 128}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'out_ptr1': '*i1', 'ks0': 'i64', 'ks1': 'i64', 'ks2': 'i64', 'ks3': 'i64', 'ks4': 'i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=1, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_bitwise_and_bitwise_not_bitwise_or_ge_lt_mul_sub_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 2912}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_bitwise_and_bitwise_not_bitwise_or_ge_lt_mul_sub_0(in_ptr0, out_ptr0, out_ptr1, ks0, ks1, ks2, ks3, ks4, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = ks0 + tmp2 = tmp0 >= tmp1 + tmp3 = ks1 + tmp4 = tmp0 < tmp3 + tmp5 = tmp2 & tmp4 + tmp6 = ks2 + tmp7 = tmp0 >= tmp6 + tmp8 = ks3 + tmp9 = tmp0 < tmp8 + tmp10 = tmp7 & tmp9 + tmp11 = tmp5 | tmp10 + tmp12 = tmp11.to(tl.int64) + tmp13 = tmp5.to(tl.int64) + tmp14 = tmp13 * tmp1 + tmp15 = tmp10.to(tl.int64) + tmp16 = ks0 + ks2 + ((-1)*ks1) + ((-1)*ks4) + tmp17 = tmp15 * tmp16 + tmp18 = tmp14 + tmp17 + tmp19 = tmp0 - tmp18 + tmp20 = tmp12 * tmp19 + tmp21 = tmp11 == 0 + tl.store(out_ptr0 + (x0), tmp20, xmask) + tl.store(out_ptr1 + (x0), tmp21, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1 = args + args.clear() + s15 = arg0_1 + s90 = arg2_1 + s87 = arg3_1 + s68 = arg4_1 + s53 = arg5_1 + s88 = arg6_1 + assert_size_stride(arg1_1, (s15, ), (1, )) + with torch.cuda._DeviceGuard(1): + torch.cuda.set_device(1) + buf0 = empty_strided_cuda((s15, ), (1, ), torch.int64) + buf1 = empty_strided_cuda((s15, ), (1, ), torch.bool) + # Topologically Sorted Source Nodes: [ge, lt, org_vocab_mask, ge_1, lt_1, added_vocab_mask, vocab_mask, mul, mul_1, valid_offset, sub_3, input_, invert], Original ATen: [aten.ge, aten.lt, aten.bitwise_and, aten.bitwise_or, aten.mul, aten.add, aten.sub, aten.bitwise_not] + stream1 = get_raw_stream(1) + triton_poi_fused_add_bitwise_and_bitwise_not_bitwise_or_ge_lt_mul_sub_0.run(arg1_1, buf0, buf1, s90, s87, s68, s53, s88, s15, stream=stream1) + del arg1_1 + return (buf0, buf1, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = 112 + arg1_1 = rand_strided((112, ), (1, ), device='cuda:1', dtype=torch.int64) + arg2_1 = 19360 + arg3_1 = 38720 + arg4_1 = 154880 + arg5_1 = 154880 + arg6_1 = 0 + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/ve/cvestd3jpljviropxyqgueyofj6royezc4qc3wv5hrazbppi7pmf.py b/.inductor_cache/ve/cvestd3jpljviropxyqgueyofj6royezc4qc3wv5hrazbppi7pmf.py new file mode 100644 index 0000000000000000000000000000000000000000..a81d3eae7a79e4e50b86803e0542bd735e4cdb10 --- /dev/null +++ b/.inductor_cache/ve/cvestd3jpljviropxyqgueyofj6royezc4qc3wv5hrazbppi7pmf.py @@ -0,0 +1,237 @@ +# AOT ID: ['8_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/fx/cfxtkr422juy23on5xj3g6onq2zte6hdsyivkzwvz6c25xld7din.py +# Topologically Sorted Source Nodes: [ge, lt, org_vocab_mask, ge_1, lt_1, added_vocab_mask, vocab_mask, mul, mul_1, valid_offset, sub_3, input_], Original ATen: [aten.ge, aten.lt, aten.bitwise_and, aten.bitwise_or, aten.mul, aten.add, aten.sub] +# Source node to ATen node mapping: +# added_vocab_mask => bitwise_and_1 +# ge => ge +# ge_1 => ge_1 +# input_ => mul_2 +# lt => lt +# lt_1 => lt_1 +# mul => mul +# mul_1 => mul_1 +# org_vocab_mask => bitwise_and +# sub_3 => sub_3 +# valid_offset => add +# vocab_mask => bitwise_or +# Graph fragment: +# %arg0_1 : Tensor "i64[1][1]cuda:7" = PlaceHolder[target=arg0_1] +# %ge : Tensor "b8[1][1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.ge.Scalar](args = (%arg0_1, %arg1_1), kwargs = {}) +# %lt : Tensor "b8[1][1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.lt.Scalar](args = (%arg0_1, %arg2_1), kwargs = {}) +# %bitwise_and : Tensor "b8[1][1]cuda:7"[num_users=2] = call_function[target=torch.ops.aten.bitwise_and.Tensor](args = (%ge, %lt), kwargs = {}) +# %ge_1 : Tensor "b8[1][1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.ge.Scalar](args = (%arg0_1, %arg3_1), kwargs = {}) +# %lt_1 : Tensor "b8[1][1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.lt.Scalar](args = (%arg0_1, %arg4_1), kwargs = {}) +# %bitwise_and_1 : Tensor "b8[1][1]cuda:7"[num_users=2] = call_function[target=torch.ops.aten.bitwise_and.Tensor](args = (%ge_1, %lt_1), kwargs = {}) +# %bitwise_or : Tensor "b8[1][1]cuda:7"[num_users=2] = call_function[target=torch.ops.aten.bitwise_or.Tensor](args = (%bitwise_and, %bitwise_and_1), kwargs = {}) +# %mul : Tensor "i64[1][1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%bitwise_and, %arg1_1), kwargs = {}) +# %mul_1 : Tensor "i64[1][1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%bitwise_and_1, %sub_2), kwargs = {}) +# %add : Tensor "i64[1][1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%mul, %mul_1), kwargs = {}) +# %sub_3 : Tensor "i64[1][1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%arg0_1, %add), kwargs = {}) +# %mul_2 : Tensor "i64[1][1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%bitwise_or, %sub_3), kwargs = {}) +# return %mul_2 +triton_poi_fused_add_bitwise_and_bitwise_or_ge_lt_mul_sub_0 = async_compile.triton('triton_poi_fused_add_bitwise_and_bitwise_or_ge_lt_mul_sub_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'ks0': 'i64', 'ks1': 'i64', 'ks2': 'i64', 'ks3': 'i64', 'ks4': 'i64', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=7, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_bitwise_and_bitwise_or_ge_lt_mul_sub_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_bitwise_and_bitwise_or_ge_lt_mul_sub_0(in_ptr0, out_ptr0, ks0, ks1, ks2, ks3, ks4, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = tl.load(in_ptr0 + (0)) + tmp1 = tl.broadcast_to(tmp0, [XBLOCK]) + tmp2 = ks0 + tmp3 = tmp1 >= tmp2 + tmp4 = ks1 + tmp5 = tmp1 < tmp4 + tmp6 = tmp3 & tmp5 + tmp7 = ks2 + tmp8 = tmp1 >= tmp7 + tmp9 = ks3 + tmp10 = tmp1 < tmp9 + tmp11 = tmp8 & tmp10 + tmp12 = tmp6 | tmp11 + tmp13 = tmp12.to(tl.int64) + tmp14 = tmp6.to(tl.int64) + tmp15 = tmp14 * tmp2 + tmp16 = tmp11.to(tl.int64) + tmp17 = ks0 + ks2 + ((-1)*ks1) + ((-1)*ks4) + tmp18 = tmp16 * tmp17 + tmp19 = tmp15 + tmp18 + tmp20 = tmp1 - tmp19 + tmp21 = tmp13 * tmp20 + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp21, None) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/gk/cgklxkfsup6sp5i2de525how5cps54e7gazp2nra67ocunfdqr6q.py +# Topologically Sorted Source Nodes: [ge, lt, org_vocab_mask, ge_1, lt_1, added_vocab_mask, vocab_mask, invert], Original ATen: [aten.ge, aten.lt, aten.bitwise_and, aten.bitwise_or, aten.bitwise_not] +# Source node to ATen node mapping: +# added_vocab_mask => bitwise_and_1 +# ge => ge +# ge_1 => ge_1 +# invert => bitwise_not +# lt => lt +# lt_1 => lt_1 +# org_vocab_mask => bitwise_and +# vocab_mask => bitwise_or +# Graph fragment: +# %arg0_1 : Tensor "i64[1][1]cuda:7" = PlaceHolder[target=arg0_1] +# %ge : Tensor "b8[1][1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.ge.Scalar](args = (%arg0_1, %arg1_1), kwargs = {}) +# %lt : Tensor "b8[1][1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.lt.Scalar](args = (%arg0_1, %arg2_1), kwargs = {}) +# %bitwise_and : Tensor "b8[1][1]cuda:7"[num_users=2] = call_function[target=torch.ops.aten.bitwise_and.Tensor](args = (%ge, %lt), kwargs = {}) +# %ge_1 : Tensor "b8[1][1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.ge.Scalar](args = (%arg0_1, %arg3_1), kwargs = {}) +# %lt_1 : Tensor "b8[1][1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.lt.Scalar](args = (%arg0_1, %arg4_1), kwargs = {}) +# %bitwise_and_1 : Tensor "b8[1][1]cuda:7"[num_users=2] = call_function[target=torch.ops.aten.bitwise_and.Tensor](args = (%ge_1, %lt_1), kwargs = {}) +# %bitwise_or : Tensor "b8[1][1]cuda:7"[num_users=2] = call_function[target=torch.ops.aten.bitwise_or.Tensor](args = (%bitwise_and, %bitwise_and_1), kwargs = {}) +# %bitwise_not : Tensor "b8[1][1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.bitwise_not.default](args = (%bitwise_or,), kwargs = {}) +# return %bitwise_not +triton_poi_fused_bitwise_and_bitwise_not_bitwise_or_ge_lt_1 = async_compile.triton('triton_poi_fused_bitwise_and_bitwise_not_bitwise_or_ge_lt_1', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i1', 'ks0': 'i64', 'ks1': 'i64', 'ks2': 'i64', 'ks3': 'i64', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=7, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_bitwise_and_bitwise_not_bitwise_or_ge_lt_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_bitwise_and_bitwise_not_bitwise_or_ge_lt_1(in_ptr0, out_ptr0, ks0, ks1, ks2, ks3, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = tl.load(in_ptr0 + (0)) + tmp1 = tl.broadcast_to(tmp0, [XBLOCK]) + tmp2 = ks0 + tmp3 = tmp1 >= tmp2 + tmp4 = ks1 + tmp5 = tmp1 < tmp4 + tmp6 = tmp3 & tmp5 + tmp7 = ks2 + tmp8 = tmp1 >= tmp7 + tmp9 = ks3 + tmp10 = tmp1 < tmp9 + tmp11 = tmp8 & tmp10 + tmp12 = tmp6 | tmp11 + tmp13 = tmp12 == 0 + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp13, None) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1 = args + args.clear() + s90 = arg1_1 + s87 = arg2_1 + s68 = arg3_1 + s53 = arg4_1 + s88 = arg5_1 + assert_size_stride(arg0_1, (1, ), (1, )) + with torch.cuda._DeviceGuard(7): + torch.cuda.set_device(7) + buf0 = empty_strided_cuda((1, ), (1, ), torch.int64) + # Topologically Sorted Source Nodes: [ge, lt, org_vocab_mask, ge_1, lt_1, added_vocab_mask, vocab_mask, mul, mul_1, valid_offset, sub_3, input_], Original ATen: [aten.ge, aten.lt, aten.bitwise_and, aten.bitwise_or, aten.mul, aten.add, aten.sub] + stream7 = get_raw_stream(7) + triton_poi_fused_add_bitwise_and_bitwise_or_ge_lt_mul_sub_0.run(arg0_1, buf0, s90, s87, s68, s53, s88, 1, stream=stream7) + buf1 = empty_strided_cuda((1, ), (1, ), torch.bool) + # Topologically Sorted Source Nodes: [ge, lt, org_vocab_mask, ge_1, lt_1, added_vocab_mask, vocab_mask, invert], Original ATen: [aten.ge, aten.lt, aten.bitwise_and, aten.bitwise_or, aten.bitwise_not] + stream7 = get_raw_stream(7) + triton_poi_fused_bitwise_and_bitwise_not_bitwise_or_ge_lt_1.run(arg0_1, buf1, s90, s87, s68, s53, 1, stream=stream7) + del arg0_1 + return (buf0, buf1, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = rand_strided((1, ), (1, ), device='cuda:7', dtype=torch.int64) + arg1_1 = 135520 + arg2_1 = 154880 + arg3_1 = 154880 + arg4_1 = 154880 + arg5_1 = 0 + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/vg/cvgci5k63gha5jorgnftge6uzqnuqxhzle6ijrzbqovefvmeaacy.py b/.inductor_cache/vg/cvgci5k63gha5jorgnftge6uzqnuqxhzle6ijrzbqovefvmeaacy.py new file mode 100644 index 0000000000000000000000000000000000000000..7a0e527cbb1af79db13690687fa6d1c25a3ce95f --- /dev/null +++ b/.inductor_cache/vg/cvgci5k63gha5jorgnftge6uzqnuqxhzle6ijrzbqovefvmeaacy.py @@ -0,0 +1,24 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 2}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=4, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_gather_max_view_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 12}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_gather_max_view_1(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tl.store(out_ptr0 + (x0), tmp0, xmask) diff --git a/.inductor_cache/vo/cvol7z4dlk2uu5fqdzqfzt7zomahpzqjvbsha35q4gyykibo34n7.py b/.inductor_cache/vo/cvol7z4dlk2uu5fqdzqfzt7zomahpzqjvbsha35q4gyykibo34n7.py new file mode 100644 index 0000000000000000000000000000000000000000..e245761b83375753c4e9042305208cdb786884e3 --- /dev/null +++ b/.inductor_cache/vo/cvol7z4dlk2uu5fqdzqfzt7zomahpzqjvbsha35q4gyykibo34n7.py @@ -0,0 +1,27 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 32}, + filename=__file__, + triton_meta={'signature': {'in_out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=0, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_0', 'mutated_arg_names': ['in_out_ptr0'], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 384}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_0(in_out_ptr0, xnumel, XBLOCK : tl.constexpr): + xnumel = 32 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_out_ptr0 + (x0), xmask) + tmp1 = tl.full([1], 0.1767766952966369, tl.float32) + tmp2 = tmp0 * tmp1 + tl.store(in_out_ptr0 + (x0), tmp2, xmask) diff --git a/.inductor_cache/vp/cvpzx2kdchqc6guwkindqyt546rfti3d3jlajkry5ty3obvnc3b6.py b/.inductor_cache/vp/cvpzx2kdchqc6guwkindqyt546rfti3d3jlajkry5ty3obvnc3b6.py new file mode 100644 index 0000000000000000000000000000000000000000..68fad5b7bfcea56f1662e1161824214ae9a2677b --- /dev/null +++ b/.inductor_cache/vp/cvpzx2kdchqc6guwkindqyt546rfti3d3jlajkry5ty3obvnc3b6.py @@ -0,0 +1,25 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=1, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_gather_max_view_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_gather_max_view_1(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = tl.load(in_ptr0 + (0)) + tmp1 = tl.broadcast_to(tmp0, [XBLOCK]) + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp1, None) diff --git a/.inductor_cache/vt/cvtivqiisfqrcey4uqs73ctde7v2ftfujgfj7zlqlacgvu5i3kdv.py b/.inductor_cache/vt/cvtivqiisfqrcey4uqs73ctde7v2ftfujgfj7zlqlacgvu5i3kdv.py new file mode 100644 index 0000000000000000000000000000000000000000..b5be5e210cc0f8dc58ee023cf682d032e4cd52b4 --- /dev/null +++ b/.inductor_cache/vt/cvtivqiisfqrcey4uqs73ctde7v2ftfujgfj7zlqlacgvu5i3kdv.py @@ -0,0 +1,289 @@ +# AOT ID: ['11_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/io/ciopxhsx6vkum5sp4j2ja5xf7tlx3akuivwd444wcldaryb5abhw.py +# Topologically Sorted Source Nodes: [unsqueeze, view, expand_scores, flatten, max_1], Original ATen: [aten.unsqueeze, aten.view, aten.mul, aten.max] +# Source node to ATen node mapping: +# expand_scores => mul_1 +# flatten => view_1 +# max_1 => getitem, max_1 +# unsqueeze => unsqueeze +# view => view +# Graph fragment: +# %arg1_1 : Tensor "f32[1, 1][1, 1]cuda:7" = PlaceHolder[target=arg1_1] +# %arg2_1 : Tensor "f32[1, 1][1, 1]cuda:7" = PlaceHolder[target=arg2_1] +# %mul_1 : Tensor "f32[1, 1, 1][1, 1, 1]cuda:7" = PlaceHolder[target=mul_1] +# %unsqueeze : Tensor "f32[1, 1, 1][1, 1, 1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%arg1_1, 2), kwargs = {}) +# %view : Tensor "f32[1, 1, 1][1, 1, 1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%arg2_1, [-1, 1, 1]), kwargs = {}) +# %mul_1 : Tensor "f32[1, 1, 1][1, 1, 1]cuda:7"[num_users=2] = call_function[target=torch.ops.aten.mul.Tensor](args = (%unsqueeze, %view), kwargs = {}) +# %view_1 : Tensor "f32[1, 1][1, 1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_1, [1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %getitem : Tensor "f32[1, 1][1, 1]cuda:7"[num_users=1] = call_function[target=operator.getitem](args = (%max_1, 0), kwargs = {}) +# return %mul_1,%getitem +triton_poi_fused_max_mul_unsqueeze_view_0 = async_compile.triton('triton_poi_fused_max_mul_unsqueeze_view_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'out_ptr0': '*fp32', 'out_ptr1': '*fp32', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=7, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_max_mul_unsqueeze_view_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 2, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_max_mul_unsqueeze_view_0(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = tl.load(in_ptr0 + (0)) + tmp1 = tl.broadcast_to(tmp0, [XBLOCK]) + tmp2 = tl.load(in_ptr1 + (0)) + tmp3 = tl.broadcast_to(tmp2, [XBLOCK]) + tmp4 = tmp1 * tmp3 + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp4, None) + tl.store(out_ptr1 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp4, None) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/4b/c4bzoixvavbv7tbgxpx5sajtax6yl6d6wky5k272ff4wk64t7jd7.py +# Topologically Sorted Source Nodes: [flatten, max_1, gather], Original ATen: [aten.view, aten.max, aten.gather] +# Source node to ATen node mapping: +# flatten => view_1 +# gather => gather +# max_1 => max_1 +# Graph fragment: +# %arg3_1 : Tensor "i64[1, 1][1, 1]cuda:7" = PlaceHolder[target=arg3_1] +# %view_1 : Tensor "f32[1, 1][1, 1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_1, [1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %gather : Tensor "i64[1, 1][1, 1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.gather.default](args = (%arg3_1, 1, %getitem_1), kwargs = {}) +# return %gather +triton_poi_fused_gather_max_view_1 = async_compile.triton('triton_poi_fused_gather_max_view_1', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=7, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_gather_max_view_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_gather_max_view_1(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = tl.load(in_ptr0 + (0)) + tmp1 = tl.broadcast_to(tmp0, [XBLOCK]) + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp1, None) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/46/c46gch5kg22oprcsfx3k73s77cdoj5zwmm4trujfwwc4zc7cs72z.py +# Topologically Sorted Source Nodes: [flatten, max_1, flat_cs, floordiv, batch_offsets, repeat_interleave, selected_input_index, hidden_states], Original ATen: [aten.view, aten.max, aten.floor_divide, aten.arange, aten.unsqueeze, aten.add, aten.index] +# Source node to ATen node mapping: +# batch_offsets => iota +# flat_cs => view_4 +# flatten => view_1 +# floordiv => div +# hidden_states => index +# max_1 => max_1 +# repeat_interleave => unsqueeze_1, view_5 +# selected_input_index => add +# Graph fragment: +# %arg5_1 : Tensor "bf16[1, s87][s87, 1]cuda:7" = PlaceHolder[target=arg5_1] +# %view_1 : Tensor "f32[1, 1][1, 1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_1, [1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %view_4 : Tensor "i64[1][1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%getitem_1, [1]), kwargs = {}) +# %div : Tensor "i64[1][1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.div.Tensor_mode](args = (%view_4, 1), kwargs = {rounding_mode: floor}) +# %iota : Tensor "i64[1][1]cuda:7"[num_users=1] = call_function[target=torch.ops.prims.iota.default](args = (1,), kwargs = {start: 0, step: 1, dtype: torch.int64, device: cuda:7, requires_grad: False}) +# %unsqueeze_1 : Tensor "i64[1, 1][1, 1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%iota, 1), kwargs = {}) +# %view_5 : Tensor "i64[1][1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%expand, [1]), kwargs = {}) +# %add : Tensor "i64[1][1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%div, %view_5), kwargs = {}) +# %index : Tensor "bf16[1, s87][s87, 1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.index.Tensor](args = (%arg5_1, [%add]), kwargs = {}) +# return %index +triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2 = async_compile.triton('triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8192}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*bf16', 'out_ptr0': '*bf16', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=7, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 36864}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask).to(tl.float32) + tl.store(out_ptr0 + (x0), tmp0, xmask) +''', device_str='cuda') + + +# kernel path: /mnt/glm5_2/.inductor_cache/cy/ccynoxcuupwftgm6s5jendp46t45hc376h3dxf5etumtyzwwzikf.py +# Topologically Sorted Source Nodes: [flatten, max_1, add_2], Original ATen: [aten.view, aten.max, aten.add] +# Source node to ATen node mapping: +# add_2 => add_3 +# flatten => view_1 +# max_1 => max_1 +# Graph fragment: +# %view_1 : Tensor "f32[1, 1][1, 1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.reshape.default](args = (%mul_1, [1, 1]), kwargs = {}) +# %max_1 : [num_users=2] = call_function[target=torch.ops.aten.max.dim](args = (%view_1, -1, True), kwargs = {}) +# %add_3 : Tensor "i64[1, 1][1, 1]cuda:7"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%getitem_1, %arg6_1), kwargs = {}) +# return %add_3 +triton_poi_fused_add_max_view_3 = async_compile.triton('triton_poi_fused_add_max_view_3', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'out_ptr0': '*i64', 'ks0': 'i64', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=7, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_max_view_3', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 0, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_max_view_3(out_ptr0, ks0, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = ks0 + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32)), tmp0, None) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1 = args + args.clear() + s53 = arg0_1 + s87 = arg4_1 + s77 = arg6_1 + assert_size_stride(arg1_1, (1, 1), (1, 1)) + assert_size_stride(arg2_1, (1, 1), (1, 1)) + assert_size_stride(arg3_1, (1, 1), (1, 1)) + assert_size_stride(arg5_1, (1, s87), (s87, 1)) + with torch.cuda._DeviceGuard(7): + torch.cuda.set_device(7) + buf0 = empty_strided_cuda((1, 1, 1), (1, 1, 1), torch.float32) + buf1 = empty_strided_cuda((1, 1), (1, 1), torch.float32) + # Topologically Sorted Source Nodes: [unsqueeze, view, expand_scores, flatten, max_1], Original ATen: [aten.unsqueeze, aten.view, aten.mul, aten.max] + stream7 = get_raw_stream(7) + triton_poi_fused_max_mul_unsqueeze_view_0.run(arg1_1, arg2_1, buf0, buf1, 1, stream=stream7) + del arg1_1 + del arg2_1 + buf2 = empty_strided_cuda((1, 1), (1, 1), torch.int64) + # Topologically Sorted Source Nodes: [flatten, max_1, gather], Original ATen: [aten.view, aten.max, aten.gather] + stream7 = get_raw_stream(7) + triton_poi_fused_gather_max_view_1.run(arg3_1, buf2, 1, stream=stream7) + buf3 = empty_strided_cuda((1, s87), (s87, 1), torch.bfloat16) + # Topologically Sorted Source Nodes: [flatten, max_1, flat_cs, floordiv, batch_offsets, repeat_interleave, selected_input_index, hidden_states], Original ATen: [aten.view, aten.max, aten.floor_divide, aten.arange, aten.unsqueeze, aten.add, aten.index] + stream7 = get_raw_stream(7) + triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2.run(arg5_1, buf3, s87, stream=stream7) + del arg5_1 + buf4 = empty_strided_cuda((1, 1), (1, 1), torch.int64) + # Topologically Sorted Source Nodes: [flatten, max_1, add_2], Original ATen: [aten.view, aten.max, aten.add] + stream7 = get_raw_stream(7) + triton_poi_fused_add_max_view_3.run(buf4, s77, 1, stream=stream7) + return (reinterpret_tensor(buf2, (1, ), (1, ), 0), buf3, buf1, buf0, arg3_1, buf4, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = 1 + arg1_1 = rand_strided((1, 1), (1, 1), device='cuda:7', dtype=torch.float32) + arg2_1 = rand_strided((1, 1), (1, 1), device='cuda:7', dtype=torch.float32) + arg3_1 = rand_strided((1, 1), (1, 1), device='cuda:7', dtype=torch.int64) + arg4_1 = 6144 + arg5_1 = rand_strided((1, 6144), (6144, 1), device='cuda:7', dtype=torch.bfloat16) + arg6_1 = 1 + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/vv/cvvp5qtrcvkzdmujfntpzyjmtsstafxvfpnsgkle2jjcnsg6ojzg.py b/.inductor_cache/vv/cvvp5qtrcvkzdmujfntpzyjmtsstafxvfpnsgkle2jjcnsg6ojzg.py new file mode 100644 index 0000000000000000000000000000000000000000..b903d2dcb4e706d1643019c4a9143e78cb34d5d0 --- /dev/null +++ b/.inductor_cache/vv/cvvp5qtrcvkzdmujfntpzyjmtsstafxvfpnsgkle2jjcnsg6ojzg.py @@ -0,0 +1,45 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'ks0': 'i64', 'ks1': 'i64', 'ks2': 'i64', 'ks3': 'i64', 'ks4': 'i64', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=0, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_bitwise_and_bitwise_or_ge_lt_mul_sub_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_bitwise_and_bitwise_or_ge_lt_mul_sub_0(in_ptr0, out_ptr0, ks0, ks1, ks2, ks3, ks4, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = tl.load(in_ptr0 + (0)) + tmp1 = tl.broadcast_to(tmp0, [XBLOCK]) + tmp2 = ks0 + tmp3 = tmp1 >= tmp2 + tmp4 = ks1 + tmp5 = tmp1 < tmp4 + tmp6 = tmp3 & tmp5 + tmp7 = ks2 + tmp8 = tmp1 >= tmp7 + tmp9 = ks3 + tmp10 = tmp1 < tmp9 + tmp11 = tmp8 & tmp10 + tmp12 = tmp6 | tmp11 + tmp13 = tmp12.to(tl.int64) + tmp14 = tmp6.to(tl.int64) + tmp15 = tmp14 * tmp2 + tmp16 = tmp11.to(tl.int64) + tmp17 = ks0 + ks2 + ((-1)*ks1) + ((-1)*ks4) + tmp18 = tmp16 * tmp17 + tmp19 = tmp15 + tmp18 + tmp20 = tmp1 - tmp19 + tmp21 = tmp13 * tmp20 + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp21, None) diff --git a/.inductor_cache/vx/cvx3kcgx73mdufoqquzcxowf7ugclz7xreckm42p6weslmelfw3l.py b/.inductor_cache/vx/cvx3kcgx73mdufoqquzcxowf7ugclz7xreckm42p6weslmelfw3l.py new file mode 100644 index 0000000000000000000000000000000000000000..b4d25e49795d3faea526d93001e578fce6749b4c --- /dev/null +++ b/.inductor_cache/vx/cvx3kcgx73mdufoqquzcxowf7ugclz7xreckm42p6weslmelfw3l.py @@ -0,0 +1,29 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'out_ptr0': '*fp32', 'out_ptr1': '*fp32', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=4, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_max_mul_unsqueeze_view_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 2, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_max_mul_unsqueeze_view_0(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = tl.load(in_ptr0 + (0)) + tmp1 = tl.broadcast_to(tmp0, [XBLOCK]) + tmp2 = tl.load(in_ptr1 + (0)) + tmp3 = tl.broadcast_to(tmp2, [XBLOCK]) + tmp4 = tmp1 * tmp3 + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp4, None) + tl.store(out_ptr1 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp4, None) diff --git a/.inductor_cache/w7/cw777jl52skgwcp2okykk4ntsz5jyepbajg64kz4aktbk2ormveo.py b/.inductor_cache/w7/cw777jl52skgwcp2okykk4ntsz5jyepbajg64kz4aktbk2ormveo.py new file mode 100644 index 0000000000000000000000000000000000000000..b5bbb9406f9c836a09d0a53a589ce230be9b623d --- /dev/null +++ b/.inductor_cache/w7/cw777jl52skgwcp2okykk4ntsz5jyepbajg64kz4aktbk2ormveo.py @@ -0,0 +1,129 @@ +# AOT ID: ['4_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/wj/cwjcxvmuxpghac2vdsmzdmm3dublkryoevxshzt6tvbddf4gnctz.py +# Topologically Sorted Source Nodes: [weights_1], Original ATen: [aten.mul] +# Source node to ATen node mapping: +# weights_1 => mul_2 +# Graph fragment: +# %mm : Tensor "f32[s77, 32][32, 1]cuda:4" = PlaceHolder[target=mm] +# %mul_2 : Tensor "f32[s77, 32][32, 1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mm, 0.1767766952966369), kwargs = {}) +# return %mul_2 +triton_poi_fused_mul_0 = async_compile.triton('triton_poi_fused_mul_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 256}, + filename=__file__, + triton_meta={'signature': {'in_out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=4, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_0', 'mutated_arg_names': ['in_out_ptr0'], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 3072}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_0(in_out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_out_ptr0 + (x0), xmask) + tmp1 = tl.full([1], 0.1767766952966369, tl.float32) + tmp2 = tmp0 * tmp1 + tl.store(in_out_ptr0 + (x0), tmp2, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1 = args + args.clear() + s77 = arg1_1 + assert_size_stride(arg0_1, (32, 6144), (6144, 1)) + assert_size_stride(arg2_1, (s77, 6144), (6144, 1)) + with torch.cuda._DeviceGuard(4): + torch.cuda.set_device(4) + buf0 = empty_strided_cuda((s77, 32), (32, 1), torch.float32) + # Topologically Sorted Source Nodes: [t, weights], Original ATen: [aten.t, aten.mm] + extern_kernels.mm_dtype(arg2_1, reinterpret_tensor(arg0_1, (6144, 32), (1, 6144), 0), out_dtype=torch.float32, out=buf0) + del arg0_1 + del arg2_1 + buf1 = buf0; del buf0 # reuse + # Topologically Sorted Source Nodes: [weights_1], Original ATen: [aten.mul] + triton_poi_fused_mul_0_xnumel = 32*s77 + stream4 = get_raw_stream(4) + triton_poi_fused_mul_0.run(buf1, triton_poi_fused_mul_0_xnumel, stream=stream4) + return (buf1, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = rand_strided((32, 6144), (6144, 1), device='cuda:4', dtype=torch.bfloat16) + arg1_1 = 8 + arg2_1 = rand_strided((8, 6144), (6144, 1), device='cuda:4', dtype=torch.bfloat16) + return [arg0_1, arg1_1, arg2_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/wb/cwbm2nrymxslnj2ij6nsplxd3dckzjxoi64a5kffp74qvp63i3oq.py b/.inductor_cache/wb/cwbm2nrymxslnj2ij6nsplxd3dckzjxoi64a5kffp74qvp63i3oq.py new file mode 100644 index 0000000000000000000000000000000000000000..2da1bf6a0cc1e0d991a813acbdf7fa66c5fe5747 --- /dev/null +++ b/.inductor_cache/wb/cwbm2nrymxslnj2ij6nsplxd3dckzjxoi64a5kffp74qvp63i3oq.py @@ -0,0 +1,129 @@ +# AOT ID: ['4_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/fu/cfuumyxqcxgpceqnkpyok34tuwjkztjorwvzgp3c3ypdzqudt5wo.py +# Topologically Sorted Source Nodes: [weights_1], Original ATen: [aten.mul] +# Source node to ATen node mapping: +# weights_1 => mul_2 +# Graph fragment: +# %mm : Tensor "f32[s77, 32][32, 1]cuda:1" = PlaceHolder[target=mm] +# %mul_2 : Tensor "f32[s77, 32][32, 1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mm, 0.1767766952966369), kwargs = {}) +# return %mul_2 +triton_poi_fused_mul_0 = async_compile.triton('triton_poi_fused_mul_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 256}, + filename=__file__, + triton_meta={'signature': {'in_out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=1, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_0', 'mutated_arg_names': ['in_out_ptr0'], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 3072}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_0(in_out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_out_ptr0 + (x0), xmask) + tmp1 = tl.full([1], 0.1767766952966369, tl.float32) + tmp2 = tmp0 * tmp1 + tl.store(in_out_ptr0 + (x0), tmp2, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1 = args + args.clear() + s77 = arg1_1 + assert_size_stride(arg0_1, (32, 6144), (6144, 1)) + assert_size_stride(arg2_1, (s77, 6144), (6144, 1)) + with torch.cuda._DeviceGuard(1): + torch.cuda.set_device(1) + buf0 = empty_strided_cuda((s77, 32), (32, 1), torch.float32) + # Topologically Sorted Source Nodes: [t, weights], Original ATen: [aten.t, aten.mm] + extern_kernels.mm_dtype(arg2_1, reinterpret_tensor(arg0_1, (6144, 32), (1, 6144), 0), out_dtype=torch.float32, out=buf0) + del arg0_1 + del arg2_1 + buf1 = buf0; del buf0 # reuse + # Topologically Sorted Source Nodes: [weights_1], Original ATen: [aten.mul] + triton_poi_fused_mul_0_xnumel = 32*s77 + stream1 = get_raw_stream(1) + triton_poi_fused_mul_0.run(buf1, triton_poi_fused_mul_0_xnumel, stream=stream1) + return (buf1, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = rand_strided((32, 6144), (6144, 1), device='cuda:1', dtype=torch.bfloat16) + arg1_1 = 8 + arg2_1 = rand_strided((8, 6144), (6144, 1), device='cuda:1', dtype=torch.bfloat16) + return [arg0_1, arg1_1, arg2_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/wh/cwhk7xmd27albhf3ayzkuaqfrt4dxepjrgrydakgkfblhlcaobh3.py b/.inductor_cache/wh/cwhk7xmd27albhf3ayzkuaqfrt4dxepjrgrydakgkfblhlcaobh3.py new file mode 100644 index 0000000000000000000000000000000000000000..97c37fe71fd1c51902a27dfb690c09eae2561610 --- /dev/null +++ b/.inductor_cache/wh/cwhk7xmd27albhf3ayzkuaqfrt4dxepjrgrydakgkfblhlcaobh3.py @@ -0,0 +1,27 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 32}, + filename=__file__, + triton_meta={'signature': {'in_out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=3, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_0', 'mutated_arg_names': ['in_out_ptr0'], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 384}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_0(in_out_ptr0, xnumel, XBLOCK : tl.constexpr): + xnumel = 32 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_out_ptr0 + (x0), xmask) + tmp1 = tl.full([1], 0.1767766952966369, tl.float32) + tmp2 = tmp0 * tmp1 + tl.store(in_out_ptr0 + (x0), tmp2, xmask) diff --git a/.inductor_cache/wi/350cdb0f98ca05e87ad2bc7eb15af0a07a2e06a7a70551815aefed371b3f33f0.best_config b/.inductor_cache/wi/350cdb0f98ca05e87ad2bc7eb15af0a07a2e06a7a70551815aefed371b3f33f0.best_config new file mode 100644 index 0000000000000000000000000000000000000000..b3f296fbbd311093736dd17c59e1d11a6478f791 --- /dev/null +++ b/.inductor_cache/wi/350cdb0f98ca05e87ad2bc7eb15af0a07a2e06a7a70551815aefed371b3f33f0.best_config @@ -0,0 +1 @@ +{"XBLOCK": 256, "num_warps": 4, "num_stages": 1, "configs_hash": "7cced77f371acaa5aa7d90332a90e0c907727cfefb71d9cc9d997c24557fc44f", "found_by_coordesc": false, "time_taken_ms": 23, "triton_cache_hash": "QLXJTPJWIG7LHGEN76P7EYFUJIJLXLDECRO3I6NRHSQ4NBZC2KMA"} \ No newline at end of file diff --git a/.inductor_cache/wi/cwiqfcswhex7vhj7ibleyueyqjfnmbmvnwp4neq7ywlmz4gnod3j.py b/.inductor_cache/wi/cwiqfcswhex7vhj7ibleyueyqjfnmbmvnwp4neq7ywlmz4gnod3j.py new file mode 100644 index 0000000000000000000000000000000000000000..ac58c98e47594901f5c6b0d75ed3b85119176670 --- /dev/null +++ b/.inductor_cache/wi/cwiqfcswhex7vhj7ibleyueyqjfnmbmvnwp4neq7ywlmz4gnod3j.py @@ -0,0 +1,24 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 65536}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*bf16', 'out_ptr0': '*bf16', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=2, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 294912}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x2 = xindex + tmp0 = tl.load(in_ptr0 + (x2), xmask, eviction_policy='evict_last').to(tl.float32) + tl.store(out_ptr0 + (x2), tmp0, xmask) diff --git a/.inductor_cache/wj/cwjcxvmuxpghac2vdsmzdmm3dublkryoevxshzt6tvbddf4gnctz.py b/.inductor_cache/wj/cwjcxvmuxpghac2vdsmzdmm3dublkryoevxshzt6tvbddf4gnctz.py new file mode 100644 index 0000000000000000000000000000000000000000..61fcf8b492d14c29221f334387fa600d9945b701 --- /dev/null +++ b/.inductor_cache/wj/cwjcxvmuxpghac2vdsmzdmm3dublkryoevxshzt6tvbddf4gnctz.py @@ -0,0 +1,26 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 256}, + filename=__file__, + triton_meta={'signature': {'in_out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=4, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_0', 'mutated_arg_names': ['in_out_ptr0'], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 3072}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_0(in_out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_out_ptr0 + (x0), xmask) + tmp1 = tl.full([1], 0.1767766952966369, tl.float32) + tmp2 = tmp0 * tmp1 + tl.store(in_out_ptr0 + (x0), tmp2, xmask) diff --git a/.inductor_cache/wj/eb1040521a630a7d6be6d05e28cc9aea8ee242dfcaef544f2b22ed384b984bb2.best_config b/.inductor_cache/wj/eb1040521a630a7d6be6d05e28cc9aea8ee242dfcaef544f2b22ed384b984bb2.best_config new file mode 100644 index 0000000000000000000000000000000000000000..c02f1bfce8fa7f0dc61d8e10c839282b0422ba47 --- /dev/null +++ b/.inductor_cache/wj/eb1040521a630a7d6be6d05e28cc9aea8ee242dfcaef544f2b22ed384b984bb2.best_config @@ -0,0 +1 @@ +{"XBLOCK": 128, "num_warps": 4, "num_stages": 1, "configs_hash": "1b2cc4dbebb9680d3ce31843331593b159e4046c056f195ca1ccf2464d5b37d1", "found_by_coordesc": false, "time_taken_ms": 78, "triton_cache_hash": "LBOXSWDAX2GIZFOXRIZQ4S3246ZSKZAMDEVIL3FUHRGF3W6BJYLQ"} \ No newline at end of file diff --git a/.inductor_cache/wl/cwl6n55z76vqvjtabo74ouhgeo3end3yn4qdnixqjzlnmv7aasep.py b/.inductor_cache/wl/cwl6n55z76vqvjtabo74ouhgeo3end3yn4qdnixqjzlnmv7aasep.py new file mode 100644 index 0000000000000000000000000000000000000000..873b684387d68f46c44dc8128a914170c560e284 --- /dev/null +++ b/.inductor_cache/wl/cwl6n55z76vqvjtabo74ouhgeo3end3yn4qdnixqjzlnmv7aasep.py @@ -0,0 +1,177 @@ +# AOT ID: ['0_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/hu/chujwzp45m5yahhnr5syekcuiis6rtrwzqyrmq25euna5m4cxssa.py +# Topologically Sorted Source Nodes: [ge, lt, org_vocab_mask, ge_1, lt_1, added_vocab_mask, vocab_mask, mul, mul_1, valid_offset, sub_3, input_, invert], Original ATen: [aten.ge, aten.lt, aten.bitwise_and, aten.bitwise_or, aten.mul, aten.add, aten.sub, aten.bitwise_not] +# Source node to ATen node mapping: +# added_vocab_mask => bitwise_and_1 +# ge => ge +# ge_1 => ge_1 +# input_ => mul_6 +# invert => bitwise_not +# lt => lt +# lt_1 => lt_1 +# mul => mul +# mul_1 => mul_2 +# org_vocab_mask => bitwise_and +# sub_3 => sub_13 +# valid_offset => add_16 +# vocab_mask => bitwise_or +# Graph fragment: +# %arg1_1 : Tensor "i64[s15][1]cuda:5" = PlaceHolder[target=arg1_1] +# %ge : Tensor "b8[s15][1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.ge.Scalar](args = (%arg1_1, %arg2_1), kwargs = {}) +# %lt : Tensor "b8[s15][1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.lt.Scalar](args = (%arg1_1, %arg3_1), kwargs = {}) +# %bitwise_and : Tensor "b8[s15][1]cuda:5"[num_users=2] = call_function[target=torch.ops.aten.bitwise_and.Tensor](args = (%ge, %lt), kwargs = {}) +# %ge_1 : Tensor "b8[s15][1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.ge.Scalar](args = (%arg1_1, %arg4_1), kwargs = {}) +# %lt_1 : Tensor "b8[s15][1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.lt.Scalar](args = (%arg1_1, %arg5_1), kwargs = {}) +# %bitwise_and_1 : Tensor "b8[s15][1]cuda:5"[num_users=2] = call_function[target=torch.ops.aten.bitwise_and.Tensor](args = (%ge_1, %lt_1), kwargs = {}) +# %bitwise_or : Tensor "b8[s15][1]cuda:5"[num_users=2] = call_function[target=torch.ops.aten.bitwise_or.Tensor](args = (%bitwise_and, %bitwise_and_1), kwargs = {}) +# %mul : Tensor "i64[s15][1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%bitwise_and, %arg2_1), kwargs = {}) +# %mul_2 : Tensor "i64[s15][1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%bitwise_and_1, %sub_8), kwargs = {}) +# %add_16 : Tensor "i64[s15][1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%mul, %mul_2), kwargs = {}) +# %sub_13 : Tensor "i64[s15][1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%arg1_1, %add_16), kwargs = {}) +# %mul_6 : Tensor "i64[s15][1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%bitwise_or, %sub_13), kwargs = {}) +# %bitwise_not : Tensor "b8[s15][1]cuda:5"[num_users=1] = call_function[target=torch.ops.aten.bitwise_not.default](args = (%bitwise_or,), kwargs = {}) +# return %mul_6,%bitwise_not +triton_poi_fused_add_bitwise_and_bitwise_not_bitwise_or_ge_lt_mul_sub_0 = async_compile.triton('triton_poi_fused_add_bitwise_and_bitwise_not_bitwise_or_ge_lt_mul_sub_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 128}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'out_ptr1': '*i1', 'ks0': 'i64', 'ks1': 'i64', 'ks2': 'i64', 'ks3': 'i64', 'ks4': 'i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=5, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_bitwise_and_bitwise_not_bitwise_or_ge_lt_mul_sub_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 2912}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_bitwise_and_bitwise_not_bitwise_or_ge_lt_mul_sub_0(in_ptr0, out_ptr0, out_ptr1, ks0, ks1, ks2, ks3, ks4, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = ks0 + tmp2 = tmp0 >= tmp1 + tmp3 = ks1 + tmp4 = tmp0 < tmp3 + tmp5 = tmp2 & tmp4 + tmp6 = ks2 + tmp7 = tmp0 >= tmp6 + tmp8 = ks3 + tmp9 = tmp0 < tmp8 + tmp10 = tmp7 & tmp9 + tmp11 = tmp5 | tmp10 + tmp12 = tmp11.to(tl.int64) + tmp13 = tmp5.to(tl.int64) + tmp14 = tmp13 * tmp1 + tmp15 = tmp10.to(tl.int64) + tmp16 = ks0 + ks2 + ((-1)*ks1) + ((-1)*ks4) + tmp17 = tmp15 * tmp16 + tmp18 = tmp14 + tmp17 + tmp19 = tmp0 - tmp18 + tmp20 = tmp12 * tmp19 + tmp21 = tmp11 == 0 + tl.store(out_ptr0 + (x0), tmp20, xmask) + tl.store(out_ptr1 + (x0), tmp21, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1 = args + args.clear() + s15 = arg0_1 + s90 = arg2_1 + s87 = arg3_1 + s68 = arg4_1 + s53 = arg5_1 + s88 = arg6_1 + assert_size_stride(arg1_1, (s15, ), (1, )) + with torch.cuda._DeviceGuard(5): + torch.cuda.set_device(5) + buf0 = empty_strided_cuda((s15, ), (1, ), torch.int64) + buf1 = empty_strided_cuda((s15, ), (1, ), torch.bool) + # Topologically Sorted Source Nodes: [ge, lt, org_vocab_mask, ge_1, lt_1, added_vocab_mask, vocab_mask, mul, mul_1, valid_offset, sub_3, input_, invert], Original ATen: [aten.ge, aten.lt, aten.bitwise_and, aten.bitwise_or, aten.mul, aten.add, aten.sub, aten.bitwise_not] + stream5 = get_raw_stream(5) + triton_poi_fused_add_bitwise_and_bitwise_not_bitwise_or_ge_lt_mul_sub_0.run(arg1_1, buf0, buf1, s90, s87, s68, s53, s88, s15, stream=stream5) + del arg1_1 + return (buf0, buf1, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = 112 + arg1_1 = rand_strided((112, ), (1, ), device='cuda:5', dtype=torch.int64) + arg2_1 = 96800 + arg3_1 = 116160 + arg4_1 = 154880 + arg5_1 = 154880 + arg6_1 = 0 + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/wm/cwma6jddm2yawcl44p7xd2wd2nwhrno6sm44ae7ztlrw6xwtvoiy.py b/.inductor_cache/wm/cwma6jddm2yawcl44p7xd2wd2nwhrno6sm44ae7ztlrw6xwtvoiy.py new file mode 100644 index 0000000000000000000000000000000000000000..ad4ec97a952594a08d4ae61840b09ac7bbc13c23 --- /dev/null +++ b/.inductor_cache/wm/cwma6jddm2yawcl44p7xd2wd2nwhrno6sm44ae7ztlrw6xwtvoiy.py @@ -0,0 +1,24 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 2}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=6, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_gather_max_view_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 12}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_gather_max_view_1(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tl.store(out_ptr0 + (x0), tmp0, xmask) diff --git a/.inductor_cache/wu/cwuk5cadblqsicej65lgc3wdcpm3vt4hpedbi6eemxutq5pqhadk.py b/.inductor_cache/wu/cwuk5cadblqsicej65lgc3wdcpm3vt4hpedbi6eemxutq5pqhadk.py new file mode 100644 index 0000000000000000000000000000000000000000..5fe5b1d574706d70a208555c602ec341ec3fe22e --- /dev/null +++ b/.inductor_cache/wu/cwuk5cadblqsicej65lgc3wdcpm3vt4hpedbi6eemxutq5pqhadk.py @@ -0,0 +1,27 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'out_ptr0': '*fp32', 'out_ptr1': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=6, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_max_mul_unsqueeze_view_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 2, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 192}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_max_mul_unsqueeze_view_0(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp2 = tmp0 * tmp1 + tl.store(out_ptr0 + (x0), tmp2, xmask) + tl.store(out_ptr1 + (x0), tmp2, xmask) diff --git a/.inductor_cache/wv/cwv4bhf4zja523ayx77cdw4dkzcexjyttmndegvltrh5pklgztw2.py b/.inductor_cache/wv/cwv4bhf4zja523ayx77cdw4dkzcexjyttmndegvltrh5pklgztw2.py new file mode 100644 index 0000000000000000000000000000000000000000..39aa9391d713be03472048527165308f99dd39d2 --- /dev/null +++ b/.inductor_cache/wv/cwv4bhf4zja523ayx77cdw4dkzcexjyttmndegvltrh5pklgztw2.py @@ -0,0 +1,24 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=2, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_gather_max_view_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 192}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_gather_max_view_1(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tl.store(out_ptr0 + (x0), tmp0, xmask) diff --git a/.inductor_cache/wv/cwvoi4ms7ttgnk7xsmilboguzw6q6b5j2pqgucmowavjqsqjesm5.py b/.inductor_cache/wv/cwvoi4ms7ttgnk7xsmilboguzw6q6b5j2pqgucmowavjqsqjesm5.py new file mode 100644 index 0000000000000000000000000000000000000000..c7bc24b9324a397051c4493baebab07ed7fce69a --- /dev/null +++ b/.inductor_cache/wv/cwvoi4ms7ttgnk7xsmilboguzw6q6b5j2pqgucmowavjqsqjesm5.py @@ -0,0 +1,24 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 2}, + filename=__file__, + triton_meta={'signature': {'out_ptr0': '*i64', 'ks0': 'i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=6, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_max_view_3', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 0, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 8}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_max_view_3(out_ptr0, ks0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = ks0 + tl.store(out_ptr0 + (x0), tmp0, xmask) diff --git a/.inductor_cache/wy/6f8b8ad84413db3501648c5c8b9b250ca0bd3fd70b23a2e1980440f694d39cbe.best_config b/.inductor_cache/wy/6f8b8ad84413db3501648c5c8b9b250ca0bd3fd70b23a2e1980440f694d39cbe.best_config new file mode 100644 index 0000000000000000000000000000000000000000..b41b1d085075e2ff5e348820a75d4ed6274ad386 --- /dev/null +++ b/.inductor_cache/wy/6f8b8ad84413db3501648c5c8b9b250ca0bd3fd70b23a2e1980440f694d39cbe.best_config @@ -0,0 +1 @@ +{"XBLOCK": 256, "num_warps": 4, "num_stages": 1, "configs_hash": "1b2cc4dbebb9680d3ce31843331593b159e4046c056f195ca1ccf2464d5b37d1", "found_by_coordesc": false, "time_taken_ms": 79, "triton_cache_hash": "K7P5VUQTWQ2GR5KCWBMAJUJLJ4ZOKI2HSLQM523UQ5RBJFUB5GQA"} \ No newline at end of file diff --git a/.inductor_cache/wy/cwysjyxztxbr5nepr7yum3223q6fcwhi4xdszamkdcvhi4icppep.py b/.inductor_cache/wy/cwysjyxztxbr5nepr7yum3223q6fcwhi4xdszamkdcvhi4icppep.py new file mode 100644 index 0000000000000000000000000000000000000000..53b27ceaf44f2d4eccbbe78c82704ea1ebc18bb7 --- /dev/null +++ b/.inductor_cache/wy/cwysjyxztxbr5nepr7yum3223q6fcwhi4xdszamkdcvhi4icppep.py @@ -0,0 +1,26 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 256}, + filename=__file__, + triton_meta={'signature': {'in_out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=0, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_0', 'mutated_arg_names': ['in_out_ptr0'], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 3072}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_0(in_out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_out_ptr0 + (x0), xmask) + tmp1 = tl.full([1], 0.1767766952966369, tl.float32) + tmp2 = tmp0 * tmp1 + tl.store(in_out_ptr0 + (x0), tmp2, xmask) diff --git a/.inductor_cache/x2/cx25zlfcmwa2tq3fmhvg3ipgdt4bwguxjdn25hqzbcatttltawyi.py b/.inductor_cache/x2/cx25zlfcmwa2tq3fmhvg3ipgdt4bwguxjdn25hqzbcatttltawyi.py new file mode 100644 index 0000000000000000000000000000000000000000..724f905135b858dde2a7d67c4a2cdcde4d781e44 --- /dev/null +++ b/.inductor_cache/x2/cx25zlfcmwa2tq3fmhvg3ipgdt4bwguxjdn25hqzbcatttltawyi.py @@ -0,0 +1,29 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 32}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'in_ptr2': 'fp64', 'out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=0, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_unsqueeze_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 3, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 512}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_unsqueeze_0(in_ptr0, in_ptr1, in_ptr2, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp3 = in_ptr2 + tmp2 = tmp0 * tmp1 + tmp4 = tmp3.to(tl.float32) + tmp5 = tmp2 * tmp4 + tl.store(out_ptr0 + (x0), tmp5, xmask) diff --git a/.inductor_cache/x2/cx2mtula5ww735bpfmjvf6tizol5fkcgjwzziufweqtwmhl3vrxl.py b/.inductor_cache/x2/cx2mtula5ww735bpfmjvf6tizol5fkcgjwzziufweqtwmhl3vrxl.py new file mode 100644 index 0000000000000000000000000000000000000000..75c13b90343c60e2f6342d2a212997106775d70c --- /dev/null +++ b/.inductor_cache/x2/cx2mtula5ww735bpfmjvf6tizol5fkcgjwzziufweqtwmhl3vrxl.py @@ -0,0 +1,142 @@ +# AOT ID: ['5_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/fp/cfpismzcv67o6f242nmx56zdblghoc3lldc4i3lfjbyn6b74ntrq.py +# Topologically Sorted Source Nodes: [unsqueeze, mul], Original ATen: [aten.unsqueeze, aten.mul] +# Source node to ATen node mapping: +# mul => mul_2 +# unsqueeze => unsqueeze +# Graph fragment: +# %arg2_1 : Tensor "f32[s0, s3][s3, 1]cuda:1" = PlaceHolder[target=arg2_1] +# %arg3_1 : Tensor "f32[s0, s3, 1][s3, 1, 1]cuda:1" = PlaceHolder[target=arg3_1] +# %arg4_1 : Tensor "f64[][]cpu" = PlaceHolder[target=arg4_1] +# %unsqueeze : Tensor "f32[s0, s3, 1][s3, 1, 1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%arg2_1, -1), kwargs = {}) +# %mul_2 : Tensor "f32[s0, s3, 1][s3, 1, 1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%unsqueeze, %arg3_1), kwargs = {}) +# %convert_element_type_default_1 : Tensor "f32[][]cpu"[num_users=1] = call_function[target=torch.ops.prims.convert_element_type.default](args = (%arg4_1, torch.float32), kwargs = {}) +# %mul_tensor : Tensor "f32[s0, s3, 1][s3, 1, 1]cuda:1"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mul_2, %convert_element_type_default_1), kwargs = {}) +# return %mul_tensor +triton_poi_fused_mul_unsqueeze_0 = async_compile.triton('triton_poi_fused_mul_unsqueeze_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 256}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'in_ptr2': 'fp64', 'out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=1, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_unsqueeze_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 3, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 4096}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_unsqueeze_0(in_ptr0, in_ptr1, in_ptr2, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp3 = in_ptr2 + tmp2 = tmp0 * tmp1 + tmp4 = tmp3.to(tl.float32) + tmp5 = tmp2 * tmp4 + tl.store(out_ptr0 + (x0), tmp5, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1 = args + args.clear() + s7 = arg0_1 + s3 = arg1_1 + arg2_1_size = arg2_1.size() + s0 = arg2_1_size[0] + assert_size_stride(arg2_1, (s0, s3), (s3, 1)) + assert_size_stride(arg3_1, (s0, s3, 1), (s3, 1, 1)) + assert_size_stride(arg4_1, (), ()) + with torch.cuda._DeviceGuard(1): + torch.cuda.set_device(1) + buf0 = empty_strided_cuda((s0, s3, 1), (s3, 1, 1), torch.float32) + # Topologically Sorted Source Nodes: [unsqueeze, mul], Original ATen: [aten.unsqueeze, aten.mul] + triton_poi_fused_mul_unsqueeze_0_xnumel = s0*s3 + stream1 = get_raw_stream(1) + triton_poi_fused_mul_unsqueeze_0.run(arg2_1, arg3_1, arg4_1.item(), buf0, triton_poi_fused_mul_unsqueeze_0_xnumel, stream=stream1) + del arg2_1 + del arg3_1 + del arg4_1 + return (buf0, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = 8 + arg1_1 = 32 + arg2_1 = rand_strided((8, 32), (32, 1), device='cuda:1', dtype=torch.float32) + arg3_1 = rand_strided((8, 32, 1), (32, 1, 1), device='cuda:1', dtype=torch.float32) + arg4_1 = rand_strided((), (), device='cpu', dtype=torch.float64) + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/xb/b084ccf16dffd7f8914d0a96f57793565d453ea8314e74a0ba009adadc5ad950.best_config b/.inductor_cache/xb/b084ccf16dffd7f8914d0a96f57793565d453ea8314e74a0ba009adadc5ad950.best_config new file mode 100644 index 0000000000000000000000000000000000000000..b303ad7b1b688d767be874d26ddbd9a5dbd239da --- /dev/null +++ b/.inductor_cache/xb/b084ccf16dffd7f8914d0a96f57793565d453ea8314e74a0ba009adadc5ad950.best_config @@ -0,0 +1 @@ +{"XBLOCK": 512, "num_warps": 4, "num_stages": 1, "configs_hash": "7cced77f371acaa5aa7d90332a90e0c907727cfefb71d9cc9d997c24557fc44f", "found_by_coordesc": false, "time_taken_ms": 22, "triton_cache_hash": "POQCX5OOGE3MWNWU43THDSFYI6FVGVQDFZF6Y7WGC5WOUUREZBTA"} \ No newline at end of file diff --git a/.inductor_cache/xb/cxbfao4txftywezeygrrwtapgjmjuaow6yckdgujtj3ln7ukpbdn.py b/.inductor_cache/xb/cxbfao4txftywezeygrrwtapgjmjuaow6yckdgujtj3ln7ukpbdn.py new file mode 100644 index 0000000000000000000000000000000000000000..7c6219b0ada5d1872829ff62969f4129c7da7eb5 --- /dev/null +++ b/.inductor_cache/xb/cxbfao4txftywezeygrrwtapgjmjuaow6yckdgujtj3ln7ukpbdn.py @@ -0,0 +1,27 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'out_ptr0': '*fp32', 'out_ptr1': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=0, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_max_mul_unsqueeze_view_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 2, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 192}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_max_mul_unsqueeze_view_0(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp2 = tmp0 * tmp1 + tl.store(out_ptr0 + (x0), tmp2, xmask) + tl.store(out_ptr1 + (x0), tmp2, xmask) diff --git a/.inductor_cache/xb/cxbqyqxwwyvdsshstrz3zl343674btixfm5kbidvymejf6qmdoaf.py b/.inductor_cache/xb/cxbqyqxwwyvdsshstrz3zl343674btixfm5kbidvymejf6qmdoaf.py new file mode 100644 index 0000000000000000000000000000000000000000..92786d7acf820d8e34760d3975dd1f92d209e19b --- /dev/null +++ b/.inductor_cache/xb/cxbqyqxwwyvdsshstrz3zl343674btixfm5kbidvymejf6qmdoaf.py @@ -0,0 +1,24 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 65536}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*bf16', 'out_ptr0': '*bf16', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=0, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 294912}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_arange_floor_divide_index_max_unsqueeze_view_2(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x2 = xindex + tmp0 = tl.load(in_ptr0 + (x2), xmask, eviction_policy='evict_last').to(tl.float32) + tl.store(out_ptr0 + (x2), tmp0, xmask) diff --git a/.inductor_cache/xd/58fc7bbcd618d517bea5016d1fb4ec94739acf8a64194cab7ba740aa05bde4d8.best_config b/.inductor_cache/xd/58fc7bbcd618d517bea5016d1fb4ec94739acf8a64194cab7ba740aa05bde4d8.best_config new file mode 100644 index 0000000000000000000000000000000000000000..4f1fcec624fea882aa6424a4be7da1d23bd7115f --- /dev/null +++ b/.inductor_cache/xd/58fc7bbcd618d517bea5016d1fb4ec94739acf8a64194cab7ba740aa05bde4d8.best_config @@ -0,0 +1 @@ +{"XBLOCK": 256, "num_warps": 4, "num_stages": 1, "configs_hash": "1b2cc4dbebb9680d3ce31843331593b159e4046c056f195ca1ccf2464d5b37d1", "found_by_coordesc": false, "time_taken_ms": 21, "triton_cache_hash": "5FUAZKDVQOXOEQJ4ZSRVOWBR6F6PBWI7HIJDQ3SM267VH2IXPT5A"} \ No newline at end of file diff --git a/.inductor_cache/xd/cxd3xbystwp4gocdmghs5wj2gqmc5bgvjwrd3qc6rcbnrrgpjvtn.py b/.inductor_cache/xd/cxd3xbystwp4gocdmghs5wj2gqmc5bgvjwrd3qc6rcbnrrgpjvtn.py new file mode 100644 index 0000000000000000000000000000000000000000..c59986bdc6a2b3a4e9a9a66336c8a1d6b13cac6b --- /dev/null +++ b/.inductor_cache/xd/cxd3xbystwp4gocdmghs5wj2gqmc5bgvjwrd3qc6rcbnrrgpjvtn.py @@ -0,0 +1,29 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 256}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'in_ptr2': 'fp64', 'out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=6, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_unsqueeze_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 3, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 4096}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_unsqueeze_0(in_ptr0, in_ptr1, in_ptr2, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp3 = in_ptr2 + tmp2 = tmp0 * tmp1 + tmp4 = tmp3.to(tl.float32) + tmp5 = tmp2 * tmp4 + tl.store(out_ptr0 + (x0), tmp5, xmask) diff --git a/.inductor_cache/xe/cxe2gw4namqcqqmkbbvaoxplpkzu5s4cfevbu2wj5j2mddgkk6ox.py b/.inductor_cache/xe/cxe2gw4namqcqqmkbbvaoxplpkzu5s4cfevbu2wj5j2mddgkk6ox.py new file mode 100644 index 0000000000000000000000000000000000000000..6e37bf4bd96972668f8f1a71c20226380a8a2808 --- /dev/null +++ b/.inductor_cache/xe/cxe2gw4namqcqqmkbbvaoxplpkzu5s4cfevbu2wj5j2mddgkk6ox.py @@ -0,0 +1,148 @@ +# AOT ID: ['1_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/cm/ccmxrppaur3r2v4vbbprap3agtftgchtfuanrvc42n4aqej57jy6.py +# Topologically Sorted Source Nodes: [weights_1, unsqueeze, mul_1], Original ATen: [aten.mul, aten.unsqueeze] +# Source node to ATen node mapping: +# mul_1 => mul_7 +# unsqueeze => unsqueeze +# weights_1 => mul_2 +# Graph fragment: +# %mm : Tensor "f32[s77, 32][32, 1]cuda:2" = PlaceHolder[target=mm] +# %arg3_1 : Tensor "f32[s77, 32, 1][32, 1, 1]cuda:2" = PlaceHolder[target=arg3_1] +# %arg4_1 : Tensor "f64[][]cpu" = PlaceHolder[target=arg4_1] +# %mul_2 : Tensor "f32[s77, 32][32, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mm, 0.1767766952966369), kwargs = {}) +# %unsqueeze : Tensor "f32[s77, 32, 1][32, 1, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%mul_2, -1), kwargs = {}) +# %mul_7 : Tensor "f32[s77, 32, 1][32, 1, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%unsqueeze, %arg3_1), kwargs = {}) +# %convert_element_type_default_1 : Tensor "f32[][]cpu"[num_users=1] = call_function[target=torch.ops.prims.convert_element_type.default](args = (%arg4_1, torch.float32), kwargs = {}) +# %mul_tensor : Tensor "f32[s77, 32, 1][32, 1, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mul_7, %convert_element_type_default_1), kwargs = {}) +# return %mul_tensor +triton_poi_fused_mul_unsqueeze_0 = async_compile.triton('triton_poi_fused_mul_unsqueeze_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 4096}, + filename=__file__, + triton_meta={'signature': {'in_out_ptr0': '*fp32', 'in_ptr0': '*fp32', 'in_ptr1': 'fp64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=2, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_unsqueeze_0', 'mutated_arg_names': ['in_out_ptr0'], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 3, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 57344}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_unsqueeze_0(in_out_ptr0, in_ptr0, in_ptr1, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_out_ptr0 + (x0), xmask) + tmp3 = tl.load(in_ptr0 + (x0), xmask) + tmp5 = in_ptr1 + tmp1 = tl.full([1], 0.1767766952966369, tl.float32) + tmp2 = tmp0 * tmp1 + tmp4 = tmp2 * tmp3 + tmp6 = tmp5.to(tl.float32) + tmp7 = tmp4 * tmp6 + tl.store(in_out_ptr0 + (x0), tmp7, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1 = args + args.clear() + s77 = arg1_1 + assert_size_stride(arg0_1, (32, 6144), (6144, 1)) + assert_size_stride(arg2_1, (s77, 6144), (6144, 1)) + assert_size_stride(arg3_1, (s77, 32, 1), (32, 1, 1)) + assert_size_stride(arg4_1, (), ()) + with torch.cuda._DeviceGuard(2): + torch.cuda.set_device(2) + buf0 = empty_strided_cuda((s77, 32), (32, 1), torch.float32) + # Topologically Sorted Source Nodes: [t, weights], Original ATen: [aten.t, aten.mm] + extern_kernels.mm_dtype(arg2_1, reinterpret_tensor(arg0_1, (6144, 32), (1, 6144), 0), out_dtype=torch.float32, out=buf0) + del arg0_1 + del arg2_1 + buf1 = reinterpret_tensor(buf0, (s77, 32, 1), (32, 1, 1), 0); del buf0 # reuse + # Topologically Sorted Source Nodes: [weights_1, unsqueeze, mul_1], Original ATen: [aten.mul, aten.unsqueeze] + triton_poi_fused_mul_unsqueeze_0_xnumel = 32*s77 + stream2 = get_raw_stream(2) + triton_poi_fused_mul_unsqueeze_0.run(buf1, arg3_1, arg4_1.item(), triton_poi_fused_mul_unsqueeze_0_xnumel, stream=stream2) + del arg3_1 + del arg4_1 + return (buf1, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = rand_strided((32, 6144), (6144, 1), device='cuda:2', dtype=torch.bfloat16) + arg1_1 = 112 + arg2_1 = rand_strided((112, 6144), (6144, 1), device='cuda:2', dtype=torch.bfloat16) + arg3_1 = rand_strided((112, 32, 1), (32, 1, 1), device='cuda:2', dtype=torch.float32) + arg4_1 = rand_strided((), (), device='cpu', dtype=torch.float64) + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/xh/cxh7sezmoqxcccmmupak5i6lq3msgfodcae6rcxakp76aq3atfnr.py b/.inductor_cache/xh/cxh7sezmoqxcccmmupak5i6lq3msgfodcae6rcxakp76aq3atfnr.py new file mode 100644 index 0000000000000000000000000000000000000000..73470c62a1876c5a7b1111ea07fb5867b04cb808 --- /dev/null +++ b/.inductor_cache/xh/cxh7sezmoqxcccmmupak5i6lq3msgfodcae6rcxakp76aq3atfnr.py @@ -0,0 +1,27 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 8}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'out_ptr0': '*fp32', 'out_ptr1': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=7, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_max_mul_unsqueeze_view_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 2, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 192}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_max_mul_unsqueeze_view_0(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp2 = tmp0 * tmp1 + tl.store(out_ptr0 + (x0), tmp2, xmask) + tl.store(out_ptr1 + (x0), tmp2, xmask) diff --git a/.inductor_cache/xm/cxmydgvlc6z7h3dihccnog72dwdfzq2euk54gct3xw7kuaatvlvo.py b/.inductor_cache/xm/cxmydgvlc6z7h3dihccnog72dwdfzq2euk54gct3xw7kuaatvlvo.py new file mode 100644 index 0000000000000000000000000000000000000000..446f3a9cb901a527bef4b54a6f5eb3fd6d6aa5cf --- /dev/null +++ b/.inductor_cache/xm/cxmydgvlc6z7h3dihccnog72dwdfzq2euk54gct3xw7kuaatvlvo.py @@ -0,0 +1,137 @@ +# AOT ID: ['10_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/fp/cfpwme7ccf4xkklj24tlioasyfry5kxcubv6xqgvx2ytwbie4j7y.py +# Topologically Sorted Source Nodes: [unsqueeze, mul], Original ATen: [aten.unsqueeze, aten.mul] +# Source node to ATen node mapping: +# mul => mul_2 +# unsqueeze => unsqueeze +# Graph fragment: +# %arg1_1 : Tensor "f32[1, s3][s3, 1]cuda:4" = PlaceHolder[target=arg1_1] +# %arg2_1 : Tensor "f32[1, s3, 1][s3, 1, 1]cuda:4" = PlaceHolder[target=arg2_1] +# %arg3_1 : Tensor "f64[][]cpu" = PlaceHolder[target=arg3_1] +# %unsqueeze : Tensor "f32[1, s3, 1][s3, 1, 1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%arg1_1, -1), kwargs = {}) +# %mul_2 : Tensor "f32[1, s3, 1][s3, 1, 1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%unsqueeze, %arg2_1), kwargs = {}) +# %convert_element_type_default_1 : Tensor "f32[][]cpu"[num_users=1] = call_function[target=torch.ops.prims.convert_element_type.default](args = (%arg3_1, torch.float32), kwargs = {}) +# %mul_tensor : Tensor "f32[1, s3, 1][s3, 1, 1]cuda:4"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mul_2, %convert_element_type_default_1), kwargs = {}) +# return %mul_tensor +triton_poi_fused_mul_unsqueeze_0 = async_compile.triton('triton_poi_fused_mul_unsqueeze_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 32}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'in_ptr2': 'fp64', 'out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=4, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_unsqueeze_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 3, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 512}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_unsqueeze_0(in_ptr0, in_ptr1, in_ptr2, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp3 = in_ptr2 + tmp2 = tmp0 * tmp1 + tmp4 = tmp3.to(tl.float32) + tmp5 = tmp2 * tmp4 + tl.store(out_ptr0 + (x0), tmp5, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1 = args + args.clear() + s3 = arg0_1 + assert_size_stride(arg1_1, (1, s3), (s3, 1)) + assert_size_stride(arg2_1, (1, s3, 1), (s3, 1, 1)) + assert_size_stride(arg3_1, (), ()) + with torch.cuda._DeviceGuard(4): + torch.cuda.set_device(4) + buf0 = empty_strided_cuda((1, s3, 1), (s3, 1, 1), torch.float32) + # Topologically Sorted Source Nodes: [unsqueeze, mul], Original ATen: [aten.unsqueeze, aten.mul] + stream4 = get_raw_stream(4) + triton_poi_fused_mul_unsqueeze_0.run(arg1_1, arg2_1, arg3_1.item(), buf0, s3, stream=stream4) + del arg1_1 + del arg2_1 + del arg3_1 + return (buf0, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = 32 + arg1_1 = rand_strided((1, 32), (32, 1), device='cuda:4', dtype=torch.float32) + arg2_1 = rand_strided((1, 32, 1), (32, 1, 1), device='cuda:4', dtype=torch.float32) + arg3_1 = rand_strided((), (), device='cpu', dtype=torch.float64) + return [arg0_1, arg1_1, arg2_1, arg3_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/xr/cxr3x44lcd4hhwbxe5pdsiuahpvuqlryelupxqrqhn6afexhn4lb.py b/.inductor_cache/xr/cxr3x44lcd4hhwbxe5pdsiuahpvuqlryelupxqrqhn6afexhn4lb.py new file mode 100644 index 0000000000000000000000000000000000000000..358b5f7938683697ce5a5e6b8663c0586a36cba7 --- /dev/null +++ b/.inductor_cache/xr/cxr3x44lcd4hhwbxe5pdsiuahpvuqlryelupxqrqhn6afexhn4lb.py @@ -0,0 +1,137 @@ +# AOT ID: ['10_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/lo/clovmdykn5vbwv6t46qzh56oikabazsc5m3deqb7gic2eq2lksnj.py +# Topologically Sorted Source Nodes: [unsqueeze, mul], Original ATen: [aten.unsqueeze, aten.mul] +# Source node to ATen node mapping: +# mul => mul_2 +# unsqueeze => unsqueeze +# Graph fragment: +# %arg1_1 : Tensor "f32[1, s3][s3, 1]cuda:2" = PlaceHolder[target=arg1_1] +# %arg2_1 : Tensor "f32[1, s3, 1][s3, 1, 1]cuda:2" = PlaceHolder[target=arg2_1] +# %arg3_1 : Tensor "f64[][]cpu" = PlaceHolder[target=arg3_1] +# %unsqueeze : Tensor "f32[1, s3, 1][s3, 1, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%arg1_1, -1), kwargs = {}) +# %mul_2 : Tensor "f32[1, s3, 1][s3, 1, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%unsqueeze, %arg2_1), kwargs = {}) +# %convert_element_type_default_1 : Tensor "f32[][]cpu"[num_users=1] = call_function[target=torch.ops.prims.convert_element_type.default](args = (%arg3_1, torch.float32), kwargs = {}) +# %mul_tensor : Tensor "f32[1, s3, 1][s3, 1, 1]cuda:2"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mul_2, %convert_element_type_default_1), kwargs = {}) +# return %mul_tensor +triton_poi_fused_mul_unsqueeze_0 = async_compile.triton('triton_poi_fused_mul_unsqueeze_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 32}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'in_ptr2': 'fp64', 'out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=2, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_unsqueeze_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 3, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 512}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_unsqueeze_0(in_ptr0, in_ptr1, in_ptr2, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp3 = in_ptr2 + tmp2 = tmp0 * tmp1 + tmp4 = tmp3.to(tl.float32) + tmp5 = tmp2 * tmp4 + tl.store(out_ptr0 + (x0), tmp5, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1 = args + args.clear() + s3 = arg0_1 + assert_size_stride(arg1_1, (1, s3), (s3, 1)) + assert_size_stride(arg2_1, (1, s3, 1), (s3, 1, 1)) + assert_size_stride(arg3_1, (), ()) + with torch.cuda._DeviceGuard(2): + torch.cuda.set_device(2) + buf0 = empty_strided_cuda((1, s3, 1), (s3, 1, 1), torch.float32) + # Topologically Sorted Source Nodes: [unsqueeze, mul], Original ATen: [aten.unsqueeze, aten.mul] + stream2 = get_raw_stream(2) + triton_poi_fused_mul_unsqueeze_0.run(arg1_1, arg2_1, arg3_1.item(), buf0, s3, stream=stream2) + del arg1_1 + del arg2_1 + del arg3_1 + return (buf0, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = 32 + arg1_1 = rand_strided((1, 32), (32, 1), device='cuda:2', dtype=torch.float32) + arg2_1 = rand_strided((1, 32, 1), (32, 1, 1), device='cuda:2', dtype=torch.float32) + arg3_1 = rand_strided((), (), device='cpu', dtype=torch.float64) + return [arg0_1, arg1_1, arg2_1, arg3_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/xx/cxxkl5refqghshncymknjukt2edxlpzm6aj3j3n6uajezsxi5tti.py b/.inductor_cache/xx/cxxkl5refqghshncymknjukt2edxlpzm6aj3j3n6uajezsxi5tti.py new file mode 100644 index 0000000000000000000000000000000000000000..c87f13d5f5b49fd601c5d9d443ac12b3a58fcbfa --- /dev/null +++ b/.inductor_cache/xx/cxxkl5refqghshncymknjukt2edxlpzm6aj3j3n6uajezsxi5tti.py @@ -0,0 +1,148 @@ +# AOT ID: ['1_inference'] +from ctypes import c_void_p, c_long, c_int +import torch +import math +import random +import os +import tempfile +from math import inf, nan +from cmath import nanj +from torch._inductor.hooks import run_intermediate_hooks +from torch._inductor.utils import maybe_profile +from torch._inductor.codegen.memory_planning import _align as align +from torch import device, empty_strided +from torch._inductor.async_compile import AsyncCompile +from torch._inductor.select_algorithm import extern_kernels +import triton +import triton.language as tl +from torch._inductor.runtime.triton_heuristics import start_graph, end_graph +from torch._C import _cuda_getCurrentRawStream as get_raw_stream + +aten = torch.ops.aten +inductor_ops = torch.ops.inductor +_quantized = torch.ops._quantized +assert_size_stride = torch._C._dynamo.guards.assert_size_stride +assert_alignment = torch._C._dynamo.guards.assert_alignment +empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu +empty_strided_cpu_pinned = torch._C._dynamo.guards._empty_strided_cpu_pinned +empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda +empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu +empty_strided_mtia = torch._C._dynamo.guards._empty_strided_mtia +reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor +alloc_from_pool = torch.ops.inductor._alloc_from_pool +async_compile = AsyncCompile() +empty_strided_p2p = torch._C._distributed_c10d._SymmetricMemory.empty_strided_p2p + + +# kernel path: /mnt/glm5_2/.inductor_cache/5v/c5vsrxfkmbxmqe35ujjlxyr37blswcxqhqzlv2r6jal54yzc27hf.py +# Topologically Sorted Source Nodes: [weights_1, unsqueeze, mul_1], Original ATen: [aten.mul, aten.unsqueeze] +# Source node to ATen node mapping: +# mul_1 => mul_7 +# unsqueeze => unsqueeze +# weights_1 => mul_2 +# Graph fragment: +# %mm : Tensor "f32[s77, 32][32, 1]cuda:0" = PlaceHolder[target=mm] +# %arg3_1 : Tensor "f32[s77, 32, 1][32, 1, 1]cuda:0" = PlaceHolder[target=arg3_1] +# %arg4_1 : Tensor "f64[][]cpu" = PlaceHolder[target=arg4_1] +# %mul_2 : Tensor "f32[s77, 32][32, 1]cuda:0"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mm, 0.1767766952966369), kwargs = {}) +# %unsqueeze : Tensor "f32[s77, 32, 1][32, 1, 1]cuda:0"[num_users=1] = call_function[target=torch.ops.aten.unsqueeze.default](args = (%mul_2, -1), kwargs = {}) +# %mul_7 : Tensor "f32[s77, 32, 1][32, 1, 1]cuda:0"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%unsqueeze, %arg3_1), kwargs = {}) +# %convert_element_type_default_1 : Tensor "f32[][]cpu"[num_users=1] = call_function[target=torch.ops.prims.convert_element_type.default](args = (%arg4_1, torch.float32), kwargs = {}) +# %mul_tensor : Tensor "f32[s77, 32, 1][32, 1, 1]cuda:0"[num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mul_7, %convert_element_type_default_1), kwargs = {}) +# return %mul_tensor +triton_poi_fused_mul_unsqueeze_0 = async_compile.triton('triton_poi_fused_mul_unsqueeze_0', ''' +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 4096}, + filename=__file__, + triton_meta={'signature': {'in_out_ptr0': '*fp32', 'in_ptr0': '*fp32', 'in_ptr1': 'fp64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=0, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_unsqueeze_0', 'mutated_arg_names': ['in_out_ptr0'], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 3, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 57344}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_unsqueeze_0(in_out_ptr0, in_ptr0, in_ptr1, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_out_ptr0 + (x0), xmask) + tmp3 = tl.load(in_ptr0 + (x0), xmask) + tmp5 = in_ptr1 + tmp1 = tl.full([1], 0.1767766952966369, tl.float32) + tmp2 = tmp0 * tmp1 + tmp4 = tmp2 * tmp3 + tmp6 = tmp5.to(tl.float32) + tmp7 = tmp4 * tmp6 + tl.store(in_out_ptr0 + (x0), tmp7, xmask) +''', device_str='cuda') + + +async_compile.wait(globals()) +del async_compile + +class Runner: + def __init__(self, partitions): + self.partitions = partitions + + def recursively_apply_fns(self, fns): + new_callables = [] + for fn, c in zip(fns, self.partitions): + new_callables.append(fn(c)) + self.partitions = new_callables + + def call(self, args): + arg0_1, arg1_1, arg2_1, arg3_1, arg4_1 = args + args.clear() + s77 = arg1_1 + assert_size_stride(arg0_1, (32, 6144), (6144, 1)) + assert_size_stride(arg2_1, (s77, 6144), (6144, 1)) + assert_size_stride(arg3_1, (s77, 32, 1), (32, 1, 1)) + assert_size_stride(arg4_1, (), ()) + with torch.cuda._DeviceGuard(0): + torch.cuda.set_device(0) + buf0 = empty_strided_cuda((s77, 32), (32, 1), torch.float32) + # Topologically Sorted Source Nodes: [t, weights], Original ATen: [aten.t, aten.mm] + extern_kernels.mm_dtype(arg2_1, reinterpret_tensor(arg0_1, (6144, 32), (1, 6144), 0), out_dtype=torch.float32, out=buf0) + del arg0_1 + del arg2_1 + buf1 = reinterpret_tensor(buf0, (s77, 32, 1), (32, 1, 1), 0); del buf0 # reuse + # Topologically Sorted Source Nodes: [weights_1, unsqueeze, mul_1], Original ATen: [aten.mul, aten.unsqueeze] + triton_poi_fused_mul_unsqueeze_0_xnumel = 32*s77 + stream0 = get_raw_stream(0) + triton_poi_fused_mul_unsqueeze_0.run(buf1, arg3_1, arg4_1.item(), triton_poi_fused_mul_unsqueeze_0_xnumel, stream=stream0) + del arg3_1 + del arg4_1 + return (buf1, ) + +runner = Runner(partitions=[]) +call = runner.call +recursively_apply_fns = runner.recursively_apply_fns + + +def get_args(): + from torch._dynamo.testing import rand_strided + arg0_1 = rand_strided((32, 6144), (6144, 1), device='cuda:0', dtype=torch.bfloat16) + arg1_1 = 112 + arg2_1 = rand_strided((112, 6144), (6144, 1), device='cuda:0', dtype=torch.bfloat16) + arg3_1 = rand_strided((112, 32, 1), (32, 1, 1), device='cuda:0', dtype=torch.float32) + arg4_1 = rand_strided((), (), device='cpu', dtype=torch.float64) + return [arg0_1, arg1_1, arg2_1, arg3_1, arg4_1] + + +def benchmark_compiled_module(args, times=10, repeat=10): + from torch._inductor.utils import print_performance + fn = lambda: call(list(args)) + return print_performance(fn, times=times, repeat=repeat) + + +if __name__ == "__main__": + from torch._inductor.wrapper_benchmark import compiled_module_main + args = get_args() + compiled_module_main('None', lambda times, repeat: benchmark_compiled_module(args, times=times, repeat=repeat)) diff --git a/.inductor_cache/xz/cxzmtt3hhh5wwfwa27c6gr5pg3osr5ateew2wwxb765c4jlaevpr.py b/.inductor_cache/xz/cxzmtt3hhh5wwfwa27c6gr5pg3osr5ateew2wwxb765c4jlaevpr.py new file mode 100644 index 0000000000000000000000000000000000000000..f1e2c7258de576ed5870ed99ab0c834680fd2435 --- /dev/null +++ b/.inductor_cache/xz/cxzmtt3hhh5wwfwa27c6gr5pg3osr5ateew2wwxb765c4jlaevpr.py @@ -0,0 +1,25 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*i64', 'out_ptr0': '*i64', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=2, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_gather_max_view_1', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 1, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_gather_max_view_1(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = tl.load(in_ptr0 + (0)) + tmp1 = tl.broadcast_to(tmp0, [XBLOCK]) + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp1, None) diff --git a/.inductor_cache/y5/cy5huhsgetyuqpiq72l6lba4jexcwsdpngrz2iwahbpopxclyk44.py b/.inductor_cache/y5/cy5huhsgetyuqpiq72l6lba4jexcwsdpngrz2iwahbpopxclyk44.py new file mode 100644 index 0000000000000000000000000000000000000000..cb306f9e5e3f1d92862e2051c5b37aaefeb49025 --- /dev/null +++ b/.inductor_cache/y5/cy5huhsgetyuqpiq72l6lba4jexcwsdpngrz2iwahbpopxclyk44.py @@ -0,0 +1,24 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 2}, + filename=__file__, + triton_meta={'signature': {'out_ptr0': '*i64', 'ks0': 'i64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=2, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_max_view_3', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 0, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 8}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_add_max_view_3(out_ptr0, ks0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = ks0 + tl.store(out_ptr0 + (x0), tmp0, xmask) diff --git a/.inductor_cache/yb/cybi6dr7sho7j2iatsr32r2n6veqd4slzwsgyc3bp7blaj7nni7w.py b/.inductor_cache/yb/cybi6dr7sho7j2iatsr32r2n6veqd4slzwsgyc3bp7blaj7nni7w.py new file mode 100644 index 0000000000000000000000000000000000000000..1f2a3c9829213ba01b1ba052bad1a87059e3ab6b --- /dev/null +++ b/.inductor_cache/yb/cybi6dr7sho7j2iatsr32r2n6veqd4slzwsgyc3bp7blaj7nni7w.py @@ -0,0 +1,31 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 2048}, + filename=__file__, + triton_meta={'signature': {'in_out_ptr0': '*fp32', 'in_ptr0': '*fp32', 'in_ptr1': 'fp64', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=2, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_unsqueeze_0', 'mutated_arg_names': ['in_out_ptr0'], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 3, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 28672}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_unsqueeze_0(in_out_ptr0, in_ptr0, in_ptr1, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_out_ptr0 + (x0), xmask) + tmp3 = tl.load(in_ptr0 + (x0), xmask) + tmp5 = in_ptr1 + tmp1 = tl.full([1], 0.1767766952966369, tl.float32) + tmp2 = tmp0 * tmp1 + tmp4 = tmp2 * tmp3 + tmp6 = tmp5.to(tl.float32) + tmp7 = tmp4 * tmp6 + tl.store(in_out_ptr0 + (x0), tmp7, xmask) diff --git a/.inductor_cache/yb/ff74cdcb3903275526ee3a16c96ed4a7f15e30fae9bbffdde8f469efb94b449e.best_config b/.inductor_cache/yb/ff74cdcb3903275526ee3a16c96ed4a7f15e30fae9bbffdde8f469efb94b449e.best_config new file mode 100644 index 0000000000000000000000000000000000000000..7debf6347db5720350d12655809c5bf511f429e0 --- /dev/null +++ b/.inductor_cache/yb/ff74cdcb3903275526ee3a16c96ed4a7f15e30fae9bbffdde8f469efb94b449e.best_config @@ -0,0 +1 @@ +{"XBLOCK": 256, "num_warps": 4, "num_stages": 1, "configs_hash": "1b2cc4dbebb9680d3ce31843331593b159e4046c056f195ca1ccf2464d5b37d1", "found_by_coordesc": false, "time_taken_ms": 43, "triton_cache_hash": "KGGY5WAIFCN23ENKRQFNT2OZB6CJLZGZIIMD5KHX6XAEJ3DEY7VA"} \ No newline at end of file diff --git a/.inductor_cache/yg/cygzxmweoklnvoy2z6e7xc72jmpynqu5ckcmk766j2dvm5llk3js.py b/.inductor_cache/yg/cygzxmweoklnvoy2z6e7xc72jmpynqu5ckcmk766j2dvm5llk3js.py new file mode 100644 index 0000000000000000000000000000000000000000..42415926cecf149f6491fd4a86f5dd9a68bc0830 --- /dev/null +++ b/.inductor_cache/yg/cygzxmweoklnvoy2z6e7xc72jmpynqu5ckcmk766j2dvm5llk3js.py @@ -0,0 +1,29 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 32}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'in_ptr2': 'fp64', 'out_ptr0': '*fp32', 'xnumel': 'i32', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=6, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_unsqueeze_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 3, 'num_store': 1, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False, 'tiling_scores': {'x': 512}}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_mul_unsqueeze_0(in_ptr0, in_ptr1, in_ptr2, out_ptr0, xnumel, XBLOCK : tl.constexpr): + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = xindex < xnumel + x0 = xindex + tmp0 = tl.load(in_ptr0 + (x0), xmask) + tmp1 = tl.load(in_ptr1 + (x0), xmask) + tmp3 = in_ptr2 + tmp2 = tmp0 * tmp1 + tmp4 = tmp3.to(tl.float32) + tmp5 = tmp2 * tmp4 + tl.store(out_ptr0 + (x0), tmp5, xmask) diff --git a/.inductor_cache/yl/cylovplln3koptl7knbgjthwhumhpciqpqqmyetfypi5rqcz3aet.py b/.inductor_cache/yl/cylovplln3koptl7knbgjthwhumhpciqpqqmyetfypi5rqcz3aet.py new file mode 100644 index 0000000000000000000000000000000000000000..134a2fbd3399769c4cc0cff573f32aee3e7828e5 --- /dev/null +++ b/.inductor_cache/yl/cylovplln3koptl7knbgjthwhumhpciqpqqmyetfypi5rqcz3aet.py @@ -0,0 +1,29 @@ + +import triton +import triton.language as tl + +from torch._inductor.runtime import triton_helpers, triton_heuristics +from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math +from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties +triton_helpers.set_driver_to_gpu() + +@triton_heuristics.pointwise( + size_hints={'x': 1}, + filename=__file__, + triton_meta={'signature': {'in_ptr0': '*fp32', 'in_ptr1': '*fp32', 'out_ptr0': '*fp32', 'out_ptr1': '*fp32', 'xnumel': 'constexpr', 'XBLOCK': 'constexpr'}, 'device': DeviceProperties(type='cuda', index=5, multi_processor_count=148, cc=100, major=10, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, max_threads_per_block=1024, warp_size=32), 'constants': {'xnumel': 1}, 'native_matmul': False, 'enable_fp_fusion': True, 'launch_pdl': False, 'disable_ftz': False, 'configs': [{(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (2,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}]}, + inductor_meta={'grid_type': 'Grid1D', 'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_max_mul_unsqueeze_view_0', 'mutated_arg_names': [], 'optimize_mem': True, 'no_x_dim': False, 'atomic_add_found': False, 'num_load': 2, 'num_store': 2, 'num_reduction': 0, 'backend_hash': 'B9347ED8E82563C0DF6E4C45E8A40BBC93F818749C1452A3CD0A7365095FE2BD', 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False, 'deterministic': False, 'force_filter_reduction_configs': False, 'mix_order_reduction_allow_multi_stages': False, 'are_deterministic_algorithms_enabled': False}, + min_elem_per_thread=0 +) +@triton.jit +def triton_poi_fused_max_mul_unsqueeze_view_0(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr): + xnumel = 1 + xoffset = tl.program_id(0) * XBLOCK + xindex = xoffset + tl.arange(0, XBLOCK)[:] + xmask = tl.full([XBLOCK], True, tl.int1)[:] + tmp0 = tl.load(in_ptr0 + (0)) + tmp1 = tl.broadcast_to(tmp0, [XBLOCK]) + tmp2 = tl.load(in_ptr1 + (0)) + tmp3 = tl.broadcast_to(tmp2, [XBLOCK]) + tmp4 = tmp1 * tmp3 + tl.store(out_ptr0 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp4, None) + tl.store(out_ptr1 + (tl.full([XBLOCK], 0, tl.int32).broadcast_to(XBLOCK)), tmp4, None)