diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Almaty b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Almaty new file mode 100644 index 0000000000000000000000000000000000000000..855abbd6e3ee338c3d46bee7b592f3d645d2c273 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Almaty differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Amman b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Amman new file mode 100644 index 0000000000000000000000000000000000000000..0a8e350a334bbee29b155fb9944c6831460d973e Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Amman differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Anadyr b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Anadyr new file mode 100644 index 0000000000000000000000000000000000000000..35c531c0709fabace97e52cacef74b4cfbbcd820 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Anadyr differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Aqtobe b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Aqtobe new file mode 100644 index 0000000000000000000000000000000000000000..3b5d6eb41883a7b32819f387b4c03c93e9d489cf Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Aqtobe differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Ashkhabad b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Ashkhabad new file mode 100644 index 0000000000000000000000000000000000000000..2bd1cb3da0f5a11024f1609b09ae68645e6ae75c Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Ashkhabad differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Baghdad b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Baghdad new file mode 100644 index 0000000000000000000000000000000000000000..c0e607234a07cd2650aabc1fd022bd5d4f99b175 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Baghdad differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Bahrain b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Bahrain new file mode 100644 index 0000000000000000000000000000000000000000..098997e7dd972ca4acedc535c4a645ee966baa33 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Bahrain differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Barnaul b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Barnaul new file mode 100644 index 0000000000000000000000000000000000000000..2f6b8101d474642410af84260fb2b88c493945b1 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Barnaul differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Beirut b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Beirut new file mode 100644 index 0000000000000000000000000000000000000000..fb266ede2279b6aff913538d9d5aae3935e53aeb Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Beirut differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Bishkek b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Bishkek new file mode 100644 index 0000000000000000000000000000000000000000..547fd5e1bd16152073f7237ad265b5c643e7cbfe Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Bishkek differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Calcutta b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Calcutta new file mode 100644 index 0000000000000000000000000000000000000000..0014046d29a38e9b8006f746fea794d7f71eb479 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Calcutta differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Chongqing b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Chongqing new file mode 100644 index 0000000000000000000000000000000000000000..91f6f8bc2e234bafd484146986bdb289082c3588 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Chongqing differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Chungking b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Chungking new file mode 100644 index 0000000000000000000000000000000000000000..91f6f8bc2e234bafd484146986bdb289082c3588 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Chungking differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Colombo b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Colombo new file mode 100644 index 0000000000000000000000000000000000000000..353fe2aa3564c79809e05e12711f90669e5e2388 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Colombo differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Damascus b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Damascus new file mode 100644 index 0000000000000000000000000000000000000000..afd956c878856e0e239887963b32ddb8327ccf38 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Damascus differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Dhaka b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Dhaka new file mode 100644 index 0000000000000000000000000000000000000000..3cf597d83f90403132573d78247e6d02e66d0583 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Dhaka differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Dili b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Dili new file mode 100644 index 0000000000000000000000000000000000000000..4614e4fc4353a7094ba5173a0bd09158ef49d9a9 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Dili differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Famagusta b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Famagusta new file mode 100644 index 0000000000000000000000000000000000000000..653b146a60e5e5641a07bfc82f9590dad1ed69f5 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Famagusta differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Hebron b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Hebron new file mode 100644 index 0000000000000000000000000000000000000000..a64fc9e7b2599e8f60d228ef3cf1743b5296cd4f Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Hebron differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Ho_Chi_Minh b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Ho_Chi_Minh new file mode 100644 index 0000000000000000000000000000000000000000..9c45ed991a230919d129c63c660aa8d1ad74d0ea Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Ho_Chi_Minh differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Hovd b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Hovd new file mode 100644 index 0000000000000000000000000000000000000000..8b9abca344daf199b554888fc4fff562a7a18e4a Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Hovd differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Irkutsk b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Irkutsk new file mode 100644 index 0000000000000000000000000000000000000000..e74a4d3f6b3a799b0fd12272c3aae0f084fb2783 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Irkutsk differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Jakarta b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Jakarta new file mode 100644 index 0000000000000000000000000000000000000000..ec4bd5747a8c9c528dfd22c8e3171851784ade59 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Jakarta differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Jayapura b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Jayapura new file mode 100644 index 0000000000000000000000000000000000000000..3002c82022f7e9a4ff1ad545ea617106a13b24e0 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Jayapura differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Kamchatka b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Kamchatka new file mode 100644 index 0000000000000000000000000000000000000000..99776f515fd53a86a6886311d91ff33b401396c3 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Kamchatka differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Katmandu b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Katmandu new file mode 100644 index 0000000000000000000000000000000000000000..751cf4a8939e898f8abe4358a98b2a5f59f65e21 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Katmandu differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Khandyga b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Khandyga new file mode 100644 index 0000000000000000000000000000000000000000..7cdc99a9803f4e1ce3c5f7f9e6cd761f178536ae Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Khandyga differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Kolkata b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Kolkata new file mode 100644 index 0000000000000000000000000000000000000000..0014046d29a38e9b8006f746fea794d7f71eb479 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Kolkata differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Krasnoyarsk b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Krasnoyarsk new file mode 100644 index 0000000000000000000000000000000000000000..4c27b2decd1159cf47285f0b18b5ed5178641e82 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Krasnoyarsk differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Kuala_Lumpur b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Kuala_Lumpur new file mode 100644 index 0000000000000000000000000000000000000000..3d9f191e3acad56fb4f73ab44a74c50cdf91c12e Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Kuala_Lumpur differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Macao b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Macao new file mode 100644 index 0000000000000000000000000000000000000000..cac65063d0dbf48e37c547fba3b67f34110d5a90 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Macao differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Makassar b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Makassar new file mode 100644 index 0000000000000000000000000000000000000000..556ba866933d37f3cfcf8042045d64e209bae30f Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Makassar differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Manila b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Manila new file mode 100644 index 0000000000000000000000000000000000000000..f4f4b04efa2b6a442d4072b3899f4dae69bdd771 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Manila differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Nicosia b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Nicosia new file mode 100644 index 0000000000000000000000000000000000000000..f7f10ab7665e94ca44fd8cd98a362cd4b304eff1 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Nicosia differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Novokuznetsk b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Novokuznetsk new file mode 100644 index 0000000000000000000000000000000000000000..a5e1b79600d21019a3b93f3e2d796129d9b1d655 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Novokuznetsk differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Omsk b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Omsk new file mode 100644 index 0000000000000000000000000000000000000000..16c5f3cfed75151d50ffc2dc483ac6279816a01f Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Omsk differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Pontianak b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Pontianak new file mode 100644 index 0000000000000000000000000000000000000000..12ce24cbeae404efe6921081d21289be452ff88d Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Pontianak differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Pyongyang b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Pyongyang new file mode 100644 index 0000000000000000000000000000000000000000..7ad7e0b2cf8fa4fc844fe8cc9c58e4f3018cead1 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Pyongyang differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Qyzylorda b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Qyzylorda new file mode 100644 index 0000000000000000000000000000000000000000..27b522a7d5e24eafdf29dd541ebbca69ce4db7b8 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Qyzylorda differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Rangoon b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Rangoon new file mode 100644 index 0000000000000000000000000000000000000000..eef37b42e8a0e7179f8113bea01f4a71d668e8ef Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Rangoon differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Riyadh b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Riyadh new file mode 100644 index 0000000000000000000000000000000000000000..8c8062471dce91a5be827d6908795ee7391a4afc Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Riyadh differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Saigon b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Saigon new file mode 100644 index 0000000000000000000000000000000000000000..9c45ed991a230919d129c63c660aa8d1ad74d0ea Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Saigon differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Samarkand b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Samarkand new file mode 100644 index 0000000000000000000000000000000000000000..8a93767bfef2cecbeee15db413a0a7c277e761a1 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Samarkand differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Seoul b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Seoul new file mode 100644 index 0000000000000000000000000000000000000000..96199e73e73aafacd89e48cb2855a96d7a134e1d Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Seoul differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Shanghai b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Shanghai new file mode 100644 index 0000000000000000000000000000000000000000..91f6f8bc2e234bafd484146986bdb289082c3588 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Shanghai differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Singapore b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Singapore new file mode 100644 index 0000000000000000000000000000000000000000..3d9f191e3acad56fb4f73ab44a74c50cdf91c12e Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Singapore differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Srednekolymsk b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Srednekolymsk new file mode 100644 index 0000000000000000000000000000000000000000..d21e7eeed5408affb3277bde903d6f5f2090ea61 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Srednekolymsk differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Taipei b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Taipei new file mode 100644 index 0000000000000000000000000000000000000000..24c43444b6751343d2915843d03e55753d4d7359 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Taipei differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Tbilisi b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Tbilisi new file mode 100644 index 0000000000000000000000000000000000000000..3b131bb10e100bc2dd619d57367a4e43c86e5316 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Tbilisi differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Thimbu b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Thimbu new file mode 100644 index 0000000000000000000000000000000000000000..95a9de9657f5b8b15aacb6e05c085c7e11bb8f55 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Thimbu differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Thimphu b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Thimphu new file mode 100644 index 0000000000000000000000000000000000000000..95a9de9657f5b8b15aacb6e05c085c7e11bb8f55 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Thimphu differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Tomsk b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Tomsk new file mode 100644 index 0000000000000000000000000000000000000000..a6e494a78cef4baaa30d06cea4186391788eb30b Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Tomsk differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Ujung_Pandang b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Ujung_Pandang new file mode 100644 index 0000000000000000000000000000000000000000..556ba866933d37f3cfcf8042045d64e209bae30f Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Ujung_Pandang differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Ulaanbaatar b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Ulaanbaatar new file mode 100644 index 0000000000000000000000000000000000000000..2aa5cc4b84d369b03684c30cdb66b7abf087f467 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Ulaanbaatar differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Ulan_Bator b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Ulan_Bator new file mode 100644 index 0000000000000000000000000000000000000000..2aa5cc4b84d369b03684c30cdb66b7abf087f467 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Ulan_Bator differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Urumqi b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Urumqi new file mode 100644 index 0000000000000000000000000000000000000000..62bdcac14db3f464ff561e32db2c6b55c0cb1866 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Urumqi differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Ust-Nera b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Ust-Nera new file mode 100644 index 0000000000000000000000000000000000000000..d05726aba9fd67bf230290b3e2d74b75e46ee214 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Ust-Nera differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Vladivostok b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Vladivostok new file mode 100644 index 0000000000000000000000000000000000000000..274a10b43d8089ed522daf9ded5b6aa3653075c9 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Vladivostok differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Yakutsk b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Yakutsk new file mode 100644 index 0000000000000000000000000000000000000000..ae65a5f9b94d196b29b68ddec7862e098d829b59 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Yakutsk differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Yangon b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Yangon new file mode 100644 index 0000000000000000000000000000000000000000..eef37b42e8a0e7179f8113bea01f4a71d668e8ef Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Yangon differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Yekaterinburg b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Yekaterinburg new file mode 100644 index 0000000000000000000000000000000000000000..d4d19ccf1e91121589a7cabff444bc916f67f9ce Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Yekaterinburg differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Yerevan b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Yerevan new file mode 100644 index 0000000000000000000000000000000000000000..0d5f6853ac79c41fcb445a23062a27aca9e471f3 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Asia/Yerevan differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/GB-Eire b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/GB-Eire new file mode 100644 index 0000000000000000000000000000000000000000..5ad74220e83e6c30a0aeefda4a00271b8ebdfcad Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/GB-Eire differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/GMT+0 b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/GMT+0 new file mode 100644 index 0000000000000000000000000000000000000000..c63474664a289aa3c3c0d8b2ce06d484679754c0 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/GMT+0 differ diff --git a/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Poland b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Poland new file mode 100644 index 0000000000000000000000000000000000000000..e33cf67171da78aa9e6eb02e50f9b9603da4c3f4 Binary files /dev/null and b/deepseek/lib/python3.10/site-packages/pytz/zoneinfo/Poland differ diff --git a/deepseekvl2/lib/python3.10/site-packages/torch/ao/nn/quantizable/__pycache__/__init__.cpython-310.pyc b/deepseekvl2/lib/python3.10/site-packages/torch/ao/nn/quantizable/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..68fb0d3c438db71e5d9f9e18826d6b6eafddb48b Binary files /dev/null and b/deepseekvl2/lib/python3.10/site-packages/torch/ao/nn/quantizable/__pycache__/__init__.cpython-310.pyc differ diff --git a/deepseekvl2/lib/python3.10/site-packages/torch/ao/nn/quantizable/modules/__pycache__/__init__.cpython-310.pyc b/deepseekvl2/lib/python3.10/site-packages/torch/ao/nn/quantizable/modules/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2110d4f3449f576b9c07b3127968e885bde85083 Binary files /dev/null and b/deepseekvl2/lib/python3.10/site-packages/torch/ao/nn/quantizable/modules/__pycache__/__init__.cpython-310.pyc differ diff --git a/deepseekvl2/lib/python3.10/site-packages/torch/ao/nn/quantizable/modules/__pycache__/activation.cpython-310.pyc b/deepseekvl2/lib/python3.10/site-packages/torch/ao/nn/quantizable/modules/__pycache__/activation.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bc6064deb6e095fe9338fdb11ef3f4c990f66fea Binary files /dev/null and b/deepseekvl2/lib/python3.10/site-packages/torch/ao/nn/quantizable/modules/__pycache__/activation.cpython-310.pyc differ diff --git a/deepseekvl2/lib/python3.10/site-packages/torch/ao/nn/quantizable/modules/__pycache__/rnn.cpython-310.pyc b/deepseekvl2/lib/python3.10/site-packages/torch/ao/nn/quantizable/modules/__pycache__/rnn.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c14d547e28130338483988d41c921134277b87f5 Binary files /dev/null and b/deepseekvl2/lib/python3.10/site-packages/torch/ao/nn/quantizable/modules/__pycache__/rnn.cpython-310.pyc differ diff --git a/deepseekvl2/lib/python3.10/site-packages/torch/ao/nn/quantizable/modules/rnn.py b/deepseekvl2/lib/python3.10/site-packages/torch/ao/nn/quantizable/modules/rnn.py new file mode 100644 index 0000000000000000000000000000000000000000..bb161fd80f38640affe794970745313c32d1f091 --- /dev/null +++ b/deepseekvl2/lib/python3.10/site-packages/torch/ao/nn/quantizable/modules/rnn.py @@ -0,0 +1,403 @@ +import numbers +from typing import Optional, Tuple +import warnings + +import torch +from torch import Tensor + +""" +We will recreate all the RNN modules as we require the modules to be decomposed +into its building blocks to be able to observe. +""" + +__all__ = [ + "LSTMCell", + "LSTM" +] + +class LSTMCell(torch.nn.Module): + r"""A quantizable long short-term memory (LSTM) cell. + + For the description and the argument types, please, refer to :class:`~torch.nn.LSTMCell` + + Examples:: + + >>> import torch.ao.nn.quantizable as nnqa + >>> rnn = nnqa.LSTMCell(10, 20) + >>> input = torch.randn(6, 10) + >>> hx = torch.randn(3, 20) + >>> cx = torch.randn(3, 20) + >>> output = [] + >>> for i in range(6): + ... hx, cx = rnn(input[i], (hx, cx)) + ... output.append(hx) + """ + _FLOAT_MODULE = torch.nn.LSTMCell + + def __init__(self, input_dim: int, hidden_dim: int, bias: bool = True, + device=None, dtype=None) -> None: + factory_kwargs = {'device': device, 'dtype': dtype} + super().__init__() + self.input_size = input_dim + self.hidden_size = hidden_dim + self.bias = bias + + self.igates = torch.nn.Linear(input_dim, 4 * hidden_dim, bias=bias, **factory_kwargs) + self.hgates = torch.nn.Linear(hidden_dim, 4 * hidden_dim, bias=bias, **factory_kwargs) + self.gates = torch.ao.nn.quantized.FloatFunctional() + + self.input_gate = torch.nn.Sigmoid() + self.forget_gate = torch.nn.Sigmoid() + self.cell_gate = torch.nn.Tanh() + self.output_gate = torch.nn.Sigmoid() + + self.fgate_cx = torch.ao.nn.quantized.FloatFunctional() + self.igate_cgate = torch.ao.nn.quantized.FloatFunctional() + self.fgate_cx_igate_cgate = torch.ao.nn.quantized.FloatFunctional() + + self.ogate_cy = torch.ao.nn.quantized.FloatFunctional() + + self.initial_hidden_state_qparams: Tuple[float, int] = (1.0, 0) + self.initial_cell_state_qparams: Tuple[float, int] = (1.0, 0) + self.hidden_state_dtype: torch.dtype = torch.quint8 + self.cell_state_dtype: torch.dtype = torch.quint8 + + def forward(self, x: Tensor, hidden: Optional[Tuple[Tensor, Tensor]] = None) -> Tuple[Tensor, Tensor]: + if hidden is None or hidden[0] is None or hidden[1] is None: + hidden = self.initialize_hidden(x.shape[0], x.is_quantized) + hx, cx = hidden + + igates = self.igates(x) + hgates = self.hgates(hx) + gates = self.gates.add(igates, hgates) + + input_gate, forget_gate, cell_gate, out_gate = gates.chunk(4, 1) + + input_gate = self.input_gate(input_gate) + forget_gate = self.forget_gate(forget_gate) + cell_gate = self.cell_gate(cell_gate) + out_gate = self.output_gate(out_gate) + + fgate_cx = self.fgate_cx.mul(forget_gate, cx) + igate_cgate = self.igate_cgate.mul(input_gate, cell_gate) + fgate_cx_igate_cgate = self.fgate_cx_igate_cgate.add(fgate_cx, igate_cgate) + cy = fgate_cx_igate_cgate + + tanh_cy = torch.tanh(cy) + hy = self.ogate_cy.mul(out_gate, tanh_cy) + return hy, cy + + def initialize_hidden(self, batch_size: int, is_quantized: bool = False) -> Tuple[Tensor, Tensor]: + h, c = torch.zeros((batch_size, self.hidden_size)), torch.zeros((batch_size, self.hidden_size)) + if is_quantized: + (h_scale, h_zp) = self.initial_hidden_state_qparams + (c_scale, c_zp) = self.initial_cell_state_qparams + h = torch.quantize_per_tensor(h, scale=h_scale, zero_point=h_zp, dtype=self.hidden_state_dtype) + c = torch.quantize_per_tensor(c, scale=c_scale, zero_point=c_zp, dtype=self.cell_state_dtype) + return h, c + + def _get_name(self): + return 'QuantizableLSTMCell' + + @classmethod + def from_params(cls, wi, wh, bi=None, bh=None): + """Uses the weights and biases to create a new LSTM cell. + + Args: + wi, wh: Weights for the input and hidden layers + bi, bh: Biases for the input and hidden layers + """ + assert (bi is None) == (bh is None) # Either both None or both have values + input_size = wi.shape[1] + hidden_size = wh.shape[1] + cell = cls(input_dim=input_size, hidden_dim=hidden_size, + bias=(bi is not None)) + cell.igates.weight = torch.nn.Parameter(wi) + if bi is not None: + cell.igates.bias = torch.nn.Parameter(bi) + cell.hgates.weight = torch.nn.Parameter(wh) + if bh is not None: + cell.hgates.bias = torch.nn.Parameter(bh) + return cell + + @classmethod + def from_float(cls, other): + assert type(other) == cls._FLOAT_MODULE + assert hasattr(other, 'qconfig'), "The float module must have 'qconfig'" + observed = cls.from_params(other.weight_ih, other.weight_hh, + other.bias_ih, other.bias_hh) + observed.qconfig = other.qconfig + observed.igates.qconfig = other.qconfig + observed.hgates.qconfig = other.qconfig + return observed + + +class _LSTMSingleLayer(torch.nn.Module): + r"""A single one-directional LSTM layer. + + The difference between a layer and a cell is that the layer can process a + sequence, while the cell only expects an instantaneous value. + """ + def __init__(self, input_dim: int, hidden_dim: int, bias: bool = True, + device=None, dtype=None) -> None: + factory_kwargs = {'device': device, 'dtype': dtype} + super().__init__() + self.cell = LSTMCell(input_dim, hidden_dim, bias=bias, **factory_kwargs) + + def forward(self, x: Tensor, hidden: Optional[Tuple[Tensor, Tensor]] = None): + result = [] + for xx in x: + hidden = self.cell(xx, hidden) + result.append(hidden[0]) # type: ignore[index] + result_tensor = torch.stack(result, 0) + return result_tensor, hidden + + @classmethod + def from_params(cls, *args, **kwargs): + cell = LSTMCell.from_params(*args, **kwargs) + layer = cls(cell.input_size, cell.hidden_size, cell.bias) + layer.cell = cell + return layer + + +class _LSTMLayer(torch.nn.Module): + r"""A single bi-directional LSTM layer.""" + def __init__(self, input_dim: int, hidden_dim: int, bias: bool = True, + batch_first: bool = False, bidirectional: bool = False, + device=None, dtype=None) -> None: + factory_kwargs = {'device': device, 'dtype': dtype} + super().__init__() + self.batch_first = batch_first + self.bidirectional = bidirectional + self.layer_fw = _LSTMSingleLayer(input_dim, hidden_dim, bias=bias, **factory_kwargs) + if self.bidirectional: + self.layer_bw = _LSTMSingleLayer(input_dim, hidden_dim, bias=bias, **factory_kwargs) + + def forward(self, x: Tensor, hidden: Optional[Tuple[Tensor, Tensor]] = None): + if self.batch_first: + x = x.transpose(0, 1) + if hidden is None: + hx_fw, cx_fw = (None, None) + else: + hx_fw, cx_fw = hidden + hidden_bw: Optional[Tuple[Tensor, Tensor]] = None + if self.bidirectional: + if hx_fw is None: + hx_bw = None + else: + hx_bw = hx_fw[1] + hx_fw = hx_fw[0] + if cx_fw is None: + cx_bw = None + else: + cx_bw = cx_fw[1] + cx_fw = cx_fw[0] + if hx_bw is not None and cx_bw is not None: + hidden_bw = hx_bw, cx_bw + if hx_fw is None and cx_fw is None: + hidden_fw = None + else: + hidden_fw = torch.jit._unwrap_optional(hx_fw), torch.jit._unwrap_optional(cx_fw) + result_fw, hidden_fw = self.layer_fw(x, hidden_fw) + + if hasattr(self, 'layer_bw') and self.bidirectional: + x_reversed = x.flip(0) + result_bw, hidden_bw = self.layer_bw(x_reversed, hidden_bw) + result_bw = result_bw.flip(0) + + result = torch.cat([result_fw, result_bw], result_fw.dim() - 1) + if hidden_fw is None and hidden_bw is None: + h = None + c = None + elif hidden_fw is None: + (h, c) = torch.jit._unwrap_optional(hidden_bw) + elif hidden_bw is None: + (h, c) = torch.jit._unwrap_optional(hidden_fw) + else: + h = torch.stack([hidden_fw[0], hidden_bw[0]], 0) # type: ignore[list-item] + c = torch.stack([hidden_fw[1], hidden_bw[1]], 0) # type: ignore[list-item] + else: + result = result_fw + h, c = torch.jit._unwrap_optional(hidden_fw) # type: ignore[assignment] + + if self.batch_first: + result.transpose_(0, 1) + + return result, (h, c) + + @classmethod + def from_float(cls, other, layer_idx=0, qconfig=None, **kwargs): + r""" + There is no FP equivalent of this class. This function is here just to + mimic the behavior of the `prepare` within the `torch.ao.quantization` + flow. + """ + assert hasattr(other, 'qconfig') or (qconfig is not None) + + input_size = kwargs.get('input_size', other.input_size) + hidden_size = kwargs.get('hidden_size', other.hidden_size) + bias = kwargs.get('bias', other.bias) + batch_first = kwargs.get('batch_first', other.batch_first) + bidirectional = kwargs.get('bidirectional', other.bidirectional) + + layer = cls(input_size, hidden_size, bias, batch_first, bidirectional) + layer.qconfig = getattr(other, 'qconfig', qconfig) + wi = getattr(other, f'weight_ih_l{layer_idx}') + wh = getattr(other, f'weight_hh_l{layer_idx}') + bi = getattr(other, f'bias_ih_l{layer_idx}', None) + bh = getattr(other, f'bias_hh_l{layer_idx}', None) + + layer.layer_fw = _LSTMSingleLayer.from_params(wi, wh, bi, bh) + + if other.bidirectional: + wi = getattr(other, f'weight_ih_l{layer_idx}_reverse') + wh = getattr(other, f'weight_hh_l{layer_idx}_reverse') + bi = getattr(other, f'bias_ih_l{layer_idx}_reverse', None) + bh = getattr(other, f'bias_hh_l{layer_idx}_reverse', None) + layer.layer_bw = _LSTMSingleLayer.from_params(wi, wh, bi, bh) + return layer + + +class LSTM(torch.nn.Module): + r"""A quantizable long short-term memory (LSTM). + + For the description and the argument types, please, refer to :class:`~torch.nn.LSTM` + + Attributes: + layers : instances of the `_LSTMLayer` + + .. note:: + To access the weights and biases, you need to access them per layer. + See examples below. + + Examples:: + + >>> import torch.ao.nn.quantizable as nnqa + >>> rnn = nnqa.LSTM(10, 20, 2) + >>> input = torch.randn(5, 3, 10) + >>> h0 = torch.randn(2, 3, 20) + >>> c0 = torch.randn(2, 3, 20) + >>> output, (hn, cn) = rnn(input, (h0, c0)) + >>> # To get the weights: + >>> # xdoctest: +SKIP + >>> print(rnn.layers[0].weight_ih) + tensor([[...]]) + >>> print(rnn.layers[0].weight_hh) + AssertionError: There is no reverse path in the non-bidirectional layer + """ + _FLOAT_MODULE = torch.nn.LSTM + + def __init__(self, input_size: int, hidden_size: int, + num_layers: int = 1, bias: bool = True, + batch_first: bool = False, dropout: float = 0., + bidirectional: bool = False, + device=None, dtype=None) -> None: + factory_kwargs = {'device': device, 'dtype': dtype} + super().__init__() + self.input_size = input_size + self.hidden_size = hidden_size + self.num_layers = num_layers + self.bias = bias + self.batch_first = batch_first + self.dropout = float(dropout) + self.bidirectional = bidirectional + self.training = False # We don't want to train using this module + num_directions = 2 if bidirectional else 1 + + if not isinstance(dropout, numbers.Number) or not 0 <= dropout <= 1 or \ + isinstance(dropout, bool): + raise ValueError("dropout should be a number in range [0, 1] " + "representing the probability of an element being " + "zeroed") + if dropout > 0: + warnings.warn("dropout option for quantizable LSTM is ignored. " + "If you are training, please, use nn.LSTM version " + "followed by `prepare` step.") + if num_layers == 1: + warnings.warn("dropout option adds dropout after all but last " + "recurrent layer, so non-zero dropout expects " + "num_layers greater than 1, but got dropout={} " + "and num_layers={}".format(dropout, num_layers)) + + layers = [_LSTMLayer(self.input_size, self.hidden_size, + self.bias, batch_first=False, + bidirectional=self.bidirectional, **factory_kwargs)] + for layer in range(1, num_layers): + layers.append(_LSTMLayer(self.hidden_size, self.hidden_size, + self.bias, batch_first=False, + bidirectional=self.bidirectional, + **factory_kwargs)) + self.layers = torch.nn.ModuleList(layers) + + def forward(self, x: Tensor, hidden: Optional[Tuple[Tensor, Tensor]] = None): + if self.batch_first: + x = x.transpose(0, 1) + + max_batch_size = x.size(1) + num_directions = 2 if self.bidirectional else 1 + if hidden is None: + zeros = torch.zeros(num_directions, max_batch_size, + self.hidden_size, dtype=torch.float, + device=x.device) + zeros.squeeze_(0) + if x.is_quantized: + zeros = torch.quantize_per_tensor(zeros, scale=1.0, + zero_point=0, dtype=x.dtype) + hxcx = [(zeros, zeros) for _ in range(self.num_layers)] + else: + hidden_non_opt = torch.jit._unwrap_optional(hidden) + if isinstance(hidden_non_opt[0], Tensor): + hx = hidden_non_opt[0].reshape(self.num_layers, num_directions, + max_batch_size, + self.hidden_size).unbind(0) + cx = hidden_non_opt[1].reshape(self.num_layers, num_directions, + max_batch_size, + self.hidden_size).unbind(0) + hxcx = [(hx[idx].squeeze_(0), cx[idx].squeeze_(0)) for idx in range(self.num_layers)] + else: + hxcx = hidden_non_opt + + hx_list = [] + cx_list = [] + for idx, layer in enumerate(self.layers): + x, (h, c) = layer(x, hxcx[idx]) + hx_list.append(torch.jit._unwrap_optional(h)) + cx_list.append(torch.jit._unwrap_optional(c)) + hx_tensor = torch.stack(hx_list) + cx_tensor = torch.stack(cx_list) + + # We are creating another dimension for bidirectional case + # need to collapse it + hx_tensor = hx_tensor.reshape(-1, hx_tensor.shape[-2], hx_tensor.shape[-1]) + cx_tensor = cx_tensor.reshape(-1, cx_tensor.shape[-2], cx_tensor.shape[-1]) + + if self.batch_first: + x = x.transpose(0, 1) + + return x, (hx_tensor, cx_tensor) + + def _get_name(self): + return 'QuantizableLSTM' + + @classmethod + def from_float(cls, other, qconfig=None): + assert isinstance(other, cls._FLOAT_MODULE) + assert (hasattr(other, 'qconfig') or qconfig) + observed = cls(other.input_size, other.hidden_size, other.num_layers, + other.bias, other.batch_first, other.dropout, + other.bidirectional) + observed.qconfig = getattr(other, 'qconfig', qconfig) + for idx in range(other.num_layers): + observed.layers[idx] = _LSTMLayer.from_float(other, idx, qconfig, + batch_first=False) + observed.eval() + observed = torch.ao.quantization.prepare(observed, inplace=True) + return observed + + @classmethod + def from_observed(cls, other): + # The whole flow is float -> observed -> quantized + # This class does float -> observed only + raise NotImplementedError("It looks like you are trying to convert a " + "non-quantizable LSTM module. Please, see " + "the examples on quantizable LSTMs.") diff --git a/deepseekvl2/lib/python3.10/site-packages/torch/ao/nn/sparse/__init__.py b/deepseekvl2/lib/python3.10/site-packages/torch/ao/nn/sparse/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0fda5a58f2984ee05b0d167297b458f62c37fc59 --- /dev/null +++ b/deepseekvl2/lib/python3.10/site-packages/torch/ao/nn/sparse/__init__.py @@ -0,0 +1 @@ +from . import quantized diff --git a/deepseekvl2/lib/python3.10/site-packages/torch/ao/nn/sparse/quantized/__init__.py b/deepseekvl2/lib/python3.10/site-packages/torch/ao/nn/sparse/quantized/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..86596ba18cf1f08e979a9e4c0ae0485627c44845 --- /dev/null +++ b/deepseekvl2/lib/python3.10/site-packages/torch/ao/nn/sparse/quantized/__init__.py @@ -0,0 +1,10 @@ +from torch.ao.nn.sparse.quantized import dynamic + +from .linear import Linear +from .linear import LinearPackedParams + +__all__ = [ + "dynamic", + "Linear", + "LinearPackedParams", +] diff --git a/deepseekvl2/lib/python3.10/site-packages/torch/ao/nn/sparse/quantized/__pycache__/linear.cpython-310.pyc b/deepseekvl2/lib/python3.10/site-packages/torch/ao/nn/sparse/quantized/__pycache__/linear.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7317c141dac6860c811738b2c1330d82c2595df5 Binary files /dev/null and b/deepseekvl2/lib/python3.10/site-packages/torch/ao/nn/sparse/quantized/__pycache__/linear.cpython-310.pyc differ diff --git a/deepseekvl2/lib/python3.10/site-packages/torch/ao/nn/sparse/quantized/linear.py b/deepseekvl2/lib/python3.10/site-packages/torch/ao/nn/sparse/quantized/linear.py new file mode 100644 index 0000000000000000000000000000000000000000..db48a825756b14c26b50b14cbc53d38c9545ac7f --- /dev/null +++ b/deepseekvl2/lib/python3.10/site-packages/torch/ao/nn/sparse/quantized/linear.py @@ -0,0 +1,197 @@ +from typing import Optional + +import torch +from torch.ao.nn.quantized.modules.utils import _quantize_weight, _hide_packed_params_repr + +__all__ = ['LinearPackedParams', 'Linear'] + +# TODO (zaf): Inherit from `quantized.LinearPackedParams` (T83294430) +class LinearPackedParams(torch.nn.Module): + _version = 1 + + def __init__(self, row_block_size=1, col_block_size=4, dtype=torch.qint8): + super().__init__() + + if dtype != torch.qint8: + raise NotImplementedError("Linear prepacking only supports QINT8") + self.dtype = dtype + wq = torch._empty_affine_quantized([1, 1], scale=1.0, zero_point=0, dtype=torch.qint8) + self.set_weight_bias(wq, None, row_block_size, col_block_size) + + def _get_name(self): + return "SparseQuantizedLinearPackedParams" + + @torch.jit.export + def set_weight_bias(self, weight: torch.Tensor, bias: Optional[torch.Tensor], + row_block_size: Optional[int], col_block_size: Optional[int]) -> None: + assert row_block_size is not None and col_block_size is not None + self._packed_params = torch.ops.sparse.qlinear_prepack(weight, bias, row_block_size, col_block_size) + + @torch.jit.export + def _weight_bias(self): + (weight, bias, block_sizes) = torch.ops.sparse.qlinear_unpack(self._packed_params) + return (weight, bias, block_sizes[0], block_sizes[1]) + + def forward(self, x): + return x + + def _save_to_state_dict(self, destination, prefix, keep_vars): + super()._save_to_state_dict(destination, prefix, keep_vars) + destination[prefix + 'dtype'] = self.dtype + destination[prefix + '_packed_params'] = self._weight_bias() + + def _load_from_state_dict(self, state_dict, prefix, local_metadata, strict, + missing_keys, unexpected_keys, error_msgs): + version = local_metadata.get('version', None) + assert version <= self._version + + self.dtype = state_dict.pop(prefix + 'dtype') + weight, bias, row_block_size, col_block_size = state_dict.pop(prefix + '_packed_params') + self.set_weight_bias(weight, bias, row_block_size, col_block_size) + + super()._load_from_state_dict(state_dict, prefix, local_metadata, False, + missing_keys, unexpected_keys, error_msgs) + + @torch.jit.export + def __getstate__(self): + return self._packed_params, self.training, self.dtype + + @torch.jit.export + def __setstate__(self, state): + (self._packed_params, self.training, self.dtype) = state + + def __repr__(self): + return self._weight_bias().__repr__() + +# TODO (zaf): Inherit from `quantized.Linear` (T83294430) +class Linear(torch.nn.Module): + r""" + A quantized sparse linear module with quantized tensor as inputs and outputs. + """ + _version = 1 + _FLOAT_MODULE = torch.nn.Linear + + def __init__(self, in_features, out_features, row_block_size, col_block_size, bias=True, dtype=torch.qint8): + super().__init__() + + if dtype != torch.qint8: + raise NotImplementedError("Only QINT8 is supported for Sparse Quantized Linear") + + self.in_features = in_features + self.out_features = out_features + + if bias: + bias = torch.zeros(self.out_features, dtype=torch.float) + else: + bias = None + + qweight = torch._empty_affine_quantized([out_features, in_features], + scale=1, zero_point=0, dtype=torch.qint8) + self._packed_params = LinearPackedParams(row_block_size=row_block_size, + col_block_size=col_block_size, + dtype=dtype) + self._packed_params.set_weight_bias(qweight, bias, row_block_size, col_block_size) + self.scale = 1.0 + self.zero_point = 0 + + @classmethod + def _get_name(cls): + return 'SparseQuantizedLinear' + + def extra_repr(self): + return 'in_features={}, out_features={}, scale={}, zero_point={}, qscheme={}'.format( + self.in_features, self.out_features, self.scale, self.zero_point, self.weight().qscheme() + ) + + def __repr__(self): + return _hide_packed_params_repr(self, LinearPackedParams) + + def forward(self, x: torch.Tensor) -> torch.Tensor: + return torch.ops.sparse.qlinear(x, self._packed_params._packed_params, self.scale, self.zero_point) + + def _save_to_state_dict(self, destination, prefix, keep_vars): + super()._save_to_state_dict(destination, prefix, keep_vars) + destination[prefix + 'scale'] = torch.tensor(self.scale) + destination[prefix + 'zero_point'] = torch.tensor(self.zero_point) + + def _load_from_state_dict(self, state_dict, prefix, local_metadata, strict, + missing_keys, unexpected_keys, error_msgs): + self.scale = float(state_dict[prefix + 'scale']) + state_dict.pop(prefix + 'scale') + + self.zero_point = int(state_dict[prefix + 'zero_point']) + state_dict.pop(prefix + 'zero_point') + + op_type = int(state_dict[prefix + 'op_type']) + state_dict.pop(prefix + 'op_type') + + version = local_metadata.get('version', None) + assert version <= self._version + + super()._load_from_state_dict( + state_dict, prefix, local_metadata, False, + missing_keys, unexpected_keys, error_msgs) + + def _weight_bias(self): + return self._packed_params._weight_bias() + + def weight(self): + return self._weight_bias()[0] + + def bias(self): + return self._weight_bias()[1] + + def set_weight_bias(self, w: torch.Tensor, b: Optional[torch.Tensor], + row_block_size: Optional[int], col_block_size: Optional[int]) -> None: + assert row_block_size is not None and col_block_size is not None + self._packed_params.set_weight_bias(w, b, row_block_size, col_block_size) + + @classmethod + def from_float(cls, mod): + r"""Create a quantized sparse module from a float module. + + We only care about the convert at this stage, no need for observers just yet. + + TODO(zaf): Need to add the sparse params to the qconfig + """ + assert type(mod) == cls._FLOAT_MODULE, cls._get_name() + \ + '.from_float only works for ' + cls._FLOAT_MODULE.__name__ + assert hasattr(mod, 'sparse_params'), \ + ('Expecting the Linear to have `sparse_params`. Make sure you have provided arguments ' + 'in the `sparsifier.squash_mask(params_to_save=("sparse_block_shape",))` method.') + sparse_block_shape = mod.sparse_params.get('sparse_block_shape', None) # type: ignore[operator, union-attr] + assert isinstance(sparse_block_shape, (tuple, list)) + assert len(sparse_block_shape) == 2 + # TODO: Need to add options to qconfig to avoid the calibration. + # TODO: Add calibration for the sparsity + assert hasattr(mod, 'qconfig'), 'Input float module must have qconfig defined' + activation_post_process = mod.activation_post_process + weight_post_process = mod.qconfig.weight() # type: ignore[operator, union-attr] + + # Assumption is that the weight is already sparsified by the + # `sparsifier.convert` + weight = mod.weight + + weight_post_process(weight) + dtype = weight_post_process.dtype + act_scale, act_zp = activation_post_process.calculate_qparams() # type: ignore[operator, union-attr] + assert dtype == torch.qint8, 'Weight observer must have dtype torch.qint8' + w_sc, w_zp = weight_post_process.calculate_qparams() + if isinstance(w_zp, torch.Tensor): + assert not torch.any(w_zp.bool()), "All weight zero points must map to 0" + else: + assert w_zp == 0, 'Weight zero point must map to 0' + qweight = _quantize_weight(weight.float(), weight_post_process) + + row_block_size = mod.sparse_params['sparse_block_shape'][0] # type: ignore[index] + col_block_size = mod.sparse_params['sparse_block_shape'][1] # type: ignore[index] + qlinear = cls(mod.in_features, + mod.out_features, + row_block_size, + col_block_size, + dtype=dtype) + qlinear.set_weight_bias(qweight, mod.bias, + row_block_size, col_block_size) # type: ignore[arg-type] + qlinear.scale = float(act_scale) + qlinear.zero_point = int(act_zp) + return qlinear diff --git a/deepseekvl2/lib/python3.10/site-packages/torch/ao/nn/sparse/quantized/utils.py b/deepseekvl2/lib/python3.10/site-packages/torch/ao/nn/sparse/quantized/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..b7afcf186de98110f0ea7f7568c3de9c98eb3fa9 --- /dev/null +++ b/deepseekvl2/lib/python3.10/site-packages/torch/ao/nn/sparse/quantized/utils.py @@ -0,0 +1,42 @@ +import threading + +__all__ = [ + "LinearBlockSparsePattern" +] + +def _is_valid_linear_block_sparse_pattern(row_block_size, col_block_size): + return (row_block_size == 1 and col_block_size == 4) or \ + (row_block_size == 8 and col_block_size == 1) + +# This is a stop-gap measure as current flow does not allow module +# specific block sparse pattern. +# Infact there is no way to convey sparse pattern via module config +# of quantization flow. Thus using the global context to convey +# sparsity pattern. +# Once the flow supports it, this should be removed. +class LinearBlockSparsePattern: + rlock = threading.RLock() + row_block_size = 1 + col_block_size = 4 + prev_row_block_size = 1 + prev_col_block_size = 4 + + def __init__(self, row_block_size=1, col_block_size=4): + assert(_is_valid_linear_block_sparse_pattern(row_block_size, col_block_size)) + LinearBlockSparsePattern.rlock.acquire() + LinearBlockSparsePattern.prev_row_block_size = LinearBlockSparsePattern.row_block_size + LinearBlockSparsePattern.prev_col_block_size = LinearBlockSparsePattern.col_block_size + LinearBlockSparsePattern.row_block_size = row_block_size + LinearBlockSparsePattern.col_block_size = col_block_size + + def __enter__(self): + pass + + def __exit__(self, exc_type, exc_value, backtrace): + LinearBlockSparsePattern.row_block_size = LinearBlockSparsePattern.prev_row_block_size + LinearBlockSparsePattern.col_block_size = LinearBlockSparsePattern.prev_col_block_size + LinearBlockSparsePattern.rlock.release() + + @staticmethod + def block_size(): + return LinearBlockSparsePattern.row_block_size, LinearBlockSparsePattern.col_block_size