resides in texture memory because texture memory is cached and is sufficiently large to accommodate the DFA (reverse trie). While shared and constant memories will result in better performance, neither is large enough to accommodate the DFA (reverse trie). Note that each state of a DFA has A transitions, where A is the alphabet size. For ASCII, A ¼ 256. Assuming that the total number of states is fewer than 65,536, each state transition of a DFA takes 2 bytes. So, a DFA with d states requires 512d bytes. In the 16 KB shared memory that our Tesla has, we can store at best a 32-state DFA. The constant memory on the Tesla is 64 KB. So, this can handle, at best, a 128-state DFA. Since the nodes of the mBM reverse trie are as large as a DFA state, it is not possible to store the reverse trie for any reasonable pattern dictionary in shared or constant memory either. Each of the mBM shift functions, shift1 and shift2, need 2 bytes per reverse-trie node. So, our shared memory can store these functions when the number of nodes does not exceed 4K; constant memory may be used for tries with fewer than 16K nodes. The bad character function BðÞ has 256 entries when the alphabet size is 256. This function may be stored in shared memory.
A nice feature of Algorithm basic is that all T threads that work on a single block can execute in lock-step fashion as there is no divergence in the execution paths of these T threads. This makes it possible for an SM of a GPU to efficiently compute an output block using T threads. With 30 SMs, we can compute 30 output blocks at a time. The pseudocode of Fig. 2 does, however, have deficiencies that are expected to result in nonoptimal performance on a GPU. These deficiencies are described below.
Deficiency D1. Since the input array resides in device memory, every reference to the array input requires a device memory transaction (in this case a read). There are two sources of inefficiency when the read accesses to input are actually made on the Tesla GPU—1) Our Tesla GPU performs device-memory transactions for a half-warp (16)
of threads at a time. The available bandwidth for a single transaction is 128 bytes. Each thread of our code reads 1 byte. So, a half-warp reads 16 bytes. Hence, barring any other limitation of our GPU, our code will utilise 1/8th the available bandwidth between device memory and an SM. 2) The Tesla is able to coalesce the device memory transactions from several threads of a half-warp into a single transaction. However, coalescing occurs only when the device memory accesses of two or more threads in a half-warp lie in the same 128-byte segment of device memory. When Sthread > 128, the values of inputStartIndex for consecutive threads in a half-warp (note that two threads t1 and t2 are in the same half-warp iff bt1=16c¼ bt2=16c) are more than 128 bytes apart. Consequently, for any given value of the loop index i, the read accesses made to the array input by the threads of a half-warp lie in different 128-byte segments and so no coalescing occurs. Although the pseudocode is written to enable all threads to simultaneously access the needed input character from device memory, an actual implementation on the Tesla GPU will serialise these accesses and, in fact, every read from device memory will transmit exactly 1 byte to an SM resulting in a 1/128 utilisation of the available bandwidth.
Deficiency D2. The writes to the array output suffer from deficiencies similar to those identified for the reads from the array input. Assuming that our DFA has no more than 216 ¼
65;536 states, each state can be encoded using 2 bytes. So, a half-warp writes 64 bytes when the available bandwidth for a half-warp is 128 bytes. Further, no coalesce takes place as no two threads of a half-warp write to the same 128-byte segment. Hence, the writers get serialised and the utilised bandwidth is 2 bytes, which is 1/64th of the available bandwidth.
อยู่ในความทรงจำเพราะความทรงจำเนื้อเนื้อเก็บไว้และมีขนาดใหญ่พอเพื่อรองรับ DFA ( ย้อนกลับทรัย ) ในขณะที่ความทรงจำร่วมกันและคงที่จะส่งผลให้ประสิทธิภาพที่ดีขึ้น และมีขนาดใหญ่พอที่จะรองรับ DFA ( ย้อนกลับทรัย ) สังเกตว่า แต่ละรัฐของเอฟมีการเปลี่ยนที่เป็น ตัวอักษร ขนาด สำหรับ ASCII , ¼ 256 . สมมติว่าจำนวนของรัฐน้อยกว่า 65536 แต่ละสถานะของเอฟใช้ 2 ไบต์ ดังนั้น , DFA กับ D รัฐต้อง 512d ไบต์ ใน 16 กิโลไบต์หน่วยความจำที่ใช้ร่วมกันที่เทสลาของเราได้ เราสามารถเก็บที่ดีที่สุด DFA 32 รัฐ ความคงที่ใน Tesla เป็น 64 กิโลไบต์ ดังนั้นนี้สามารถจัดการที่ดีที่สุด , DFA 128 รัฐ เนื่องจากโหนดของ MBM กลับพยายามเป็นรัฐที่มีขนาดใหญ่เป็น DFA , มันเป็นไปไม่ได้ที่จะเก็บกลับพยายามใด ๆที่เหมาะสมในรูปแบบพจนานุกรมร่วมกันหรือหน่วยความจำคงที่เหมือนกัน ของแต่ละกะการทำงานและ shift1 MBM , shift2 ต้องการ 2 ไบต์ต่อย้อนกลับทรัยโหนด ดังนั้น หน่วยความจำที่ใช้ร่วมกันของเราสามารถเก็บฟังก์ชันเหล่านี้เมื่อโหนดไม่เกิน 4K หน่วยความจำคงที่อาจจะใช้เพื่อพยายาม มีน้อยกว่าโหนด 16K เลวตัวฟังก์ชัน B ðÞได้ 256 รายการเมื่อตัวอักษรขนาด 256 . ฟังก์ชันนี้จะถูกเก็บไว้ในหน่วยความจำที่ใช้ร่วมกันคุณสมบัติที่ดีของขั้นตอนวิธีพื้นฐานแค่นี้ T กระทู้ที่ทำบล็อกเดียวสามารถดำเนินการในขั้นตอนการล็อคแฟชั่น ไม่มีความแตกต่างในการเส้นทางของกระทู้ T เหล่านี้ นี้จะทำให้มันเป็นไปได้สำหรับ SM ของ GPU ให้มีประสิทธิภาพการคำนวณผลผลิตการใช้บล็อค T กระทู้ 30 SMS เราสามารถคำนวณ 30 บล็อกออกในเวลา ที่เวปบอร์ดของรูปที่ 2 ไม่ อย่างไรก็ตาม มีข้อที่คาดว่าจะส่งผลให้ประสิทธิภาพ nonoptimal บน GPU . ข้อบกพร่องเหล่านี้จะอธิบายด้านล่างD1 ขาด ตั้งแต่ใส่เรย์อยู่ในหน่วยความจำอุปกรณ์ ทุกการอ้างอิงถึงอาร์เรย์ใส่ต้องใช้หน่วยความจำอุปกรณ์รายการ ( ในกรณีนี้อ่าน ) มีสองแหล่งที่มาของการไร้ประสิทธิภาพ เมื่อความเร็วในการอ่านข้อมูลจะทำใน Tesla GPU Tesla ของเราดำเนินการธุรกรรม gpu-1 ) หน่วยความจำอุปกรณ์สำหรับครึ่งโค้ง ( 16 )กระทู้ที่เวลา แบนด์วิดธ์ที่มีอยู่สำหรับรายการเดียวคือ 128 ไบต์ แต่ละหัวข้อของรหัสของเราอ่าน 1 ไบต์ ดังนั้น ครึ่งบิดอ่าน 16 ไบต์ ดังนั้น ถ้าข้อ จำกัด ใด ๆอื่น ๆของ GPU ของเรา รหัสของเราจะใช้ 1 / แบนด์วิดธ์ที่มีอยู่ระหว่างหน่วยความจำอุปกรณ์และ SM 8 2 ) Tesla สามารถรวมตัวหน่วยความจำอุปกรณ์รายการจากหลายกระทู้ของครึ่งบิดลงในรายการเดียว อย่างไรก็ตาม coalescing เกิดขึ้นเมื่อสองหรือมากกว่าอุปกรณ์หน่วยความจำเข้าถึงกระทู้ในครึ่งบิดอยู่ในส่วนของหน่วยความจำแบบ 128 ไบต์ อุปกรณ์ เมื่อ sthread > 128 , ค่า inputstartindex ติดต่อกันกระทู้ในครึ่งโค้ง ( ทราบว่าสองกระทู้ T1 และ T2 อยู่เหมือนกัน = 16c ¼ครึ่งบิด IFF 1 บาท = 16c ) มากกว่า 128 ไบต์ ต่างหาก ดังนั้น เพื่อให้มูลค่าของดัชนีห่วงผม ความเร็วในการอ่านให้ใส่เรย์ โดยหัวข้อของครึ่งวิปริตนอนในส่วน 128 ไบต์ที่แตกต่างกันและเพื่อไม่ coalescing เกิดขึ้น แม้ว่ารหัสเทียมที่เขียนเพื่อให้หัวข้อทั้งหมดพร้อมกันเข้าถึงต้องการป้อนอักขระจากหน่วยความจำอุปกรณ์ , การใช้จริงบน GPU Tesla จะ serialise เหล่านี้เข้าถึงและในความเป็นจริงทุกอ่านจากหน่วยความจำอุปกรณ์จะส่งสัญญาณว่า 1 ไบต์มี SM ผลใน 1 / 128 ใช้แบนด์วิดธ์ที่มีอยู่ .D2 ขาด ที่เขียนถึงอาร์เรย์ส่งออกประสบจากข้อบกพร่องที่คล้ายกับที่ระบุสำหรับอ่านข้อมูลจากอาร์เรย์ . สมมติว่า DFA ของเราไม่มีมากกว่า 216 ¼65 ; แต่รัฐแต่ละรัฐสามารถเข้ารหัสโดยใช้ 2 ไบต์ ดังนั้น ครึ่งแล้วเขียน 64 ไบต์เมื่อแบนด์วิดธ์ที่มีอยู่ครึ่งบิดเป็น 128 ไบต์ เพิ่มเติม ไม่มีการรวมตัวเกิดขึ้นเป็นสองเส้นครึ่ง วาร์ป เขียนเหมือนกัน 128 ไบต์ ส่วน ดังนั้น ผู้เขียนได้รับ serialised และใช้แบนด์วิดธ์ 2 ไบต์ ซึ่งเป็น 1 ใน 64 ของแบนด์วิดธ์ที่มีอยู่
การแปล กรุณารอสักครู่..
