Skip to main content

2. bin

这里的 bin 可以理解为:按图分区(partition)把 reads 分到不同的“桶”里,每个桶对应一个图分区。它是 host 侧做批处理和数据复用的单位。

结合论文上下文,具体含义如下:

  1. bin 对应一个图分区

    • Locus 先用 partitioning 算法(RBCP)把 pangenome graph 切成若干个 partition。
    • 每个 partition 包含一组 graph nodes、edges、vertex sequences、adjacency lists 等子图数据。
    • 这个 partition 在 host 侧调度时就被称为一个 bin。
    • 论文里也直接说 “their mapped bin”,即 read 映射到的那个图分区。
  2. host 按 bin 对 reads 分组

    • 每个 read 经过 seeding 后会产生 anchors,这些 anchors 会落在某个图分区里。
    • host 根据 read 主要落在哪个 partition,把它归入对应的 bin。
    • 然后 host 一次只提交一个 bin 给 Locus 处理,而不是把所有 reads 混在一起。
  3. bin 的作用:让图拓扑数据被多个 reads 复用

    • 处理一个 bin 时,该 bin 对应的子图数据(vertex sequences、adjacency lists 等)从 DRAM 加载一次。
    • 这个 bin 里的所有 β\beta 个 reads 都可以复用这份图数据。
    • 因此公式 (5) 中 topology 项是: αNpSτβ\frac{\alpha N_p S_\tau}{\beta} 这里的 β\beta 就是“每个 bin 中的 reads 数”。除以 β\beta 表示 topology 流量被这批 reads 分摊了。
  4. 公式 (6) 中的 ∣Bi∣|B_i|

    • ∣Bi∣|B_i| 表示第 ii 个 bin 里的节点数。
    • ∣Bi∣⋅Sτ|B_i| \cdot S_\tau 就是该 bin 的子图 topology 占用的片上存储大小。
    • 所以 bin 也是片上 buffer 容量约束里要装下的图数据块。
  5. bin 和 tile 的区别

    • tile:是单个 read 内部的 anchor 分批,大小是 TT 个 anchors,用于片上 LC → GC → AL 流水。
    • bin:是跨 reads 的图分区级批处理单位,用于图拓扑数据复用。
    • 一个 bin 可以包含多个 reads;每个 read 又可以分成多个 tiles。
    • bin 解决的是“图数据复用”,tile 解决的是“中间结果片上保留”。
  6. 论文中确定 bin 的方式

    • 在架构部分提到,host 会确定 bin,即 “the partition containing the most anchors during tile batching”。
    • 也就是说,一个 read 或一批 reads 的 anchors 主要落在哪个 partition,就把它归到哪个 bin。

简单总结:
bin = 图分区对应的批处理桶。Host 把 reads 按映射到的图分区放入不同 bin,一次处理一个 bin,使该分区的子图数据只需加载一次,供该 bin 内所有 reads 共享,从而降低 DRAM topology 流量。